Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

VariableAccessor.GetBoolean(String, Boolean, Boolean) Method

Returns a Boolean that contains the value of the specified variable.

[Visual Basic]
Public Overloads Sub GetBoolean( _
   ByVal name As String, _
   ByVal defaultValue As Boolean, _
   ByVal throwOnInvalidValue As Boolean _
)
[C#]
public bool GetBoolean(
   string name,
   bool defaultValue,
   bool throwOnInvalidValue
);

Parameters

name
The name of the variable to be read.
defaultValue
The value to be returned if ResolveVariable returns null.
throwOnInvalidValue
If false, suppresses exceptions if the result of ResolveVariable cannot be parsed and returns defaultValue instead.

Return Value

A Boolean that contains the value of the specified variable or defaultValue, if ResolveVariable cannot be parsed.

See Also

VariableAccessor Class | Spring.Objects.Factory.Config Namespace | VariableAccessor.GetBoolean Overload List