The GetInt
method retrieves an integer value associated with a specified StringToken
from the RenderAttributes
collection. If the specified token does not exist, the method returns a default integer value.
The GetInt
method retrieves an integer value associated with a specified StringToken
from the RenderAttributes
collection. If the specified token does not exist, the method returns a default integer value.
To use the GetInt
method, you need to provide a StringToken
that identifies the attribute you want to retrieve and a reference to an integer that represents the default value to return if the attribute is not found.
RenderAttributes renderAttributes = new RenderAttributes(); StringToken token = new StringToken("exampleToken"); int defaultValue = 10; int result = renderAttributes.GetInt(ref token, ref defaultValue); // result will be the value associated with 'exampleToken' or 10 if not found.