Class BooleanValueConverter
Implementation of ICoercesValueToBoolean which converts a value to a boolean.
Inheritance
System.Object
BooleanValueConverter
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ZptSharp.Expressions.NotExpressions
Assembly: ZptSharp.dll
Syntax
public class BooleanValueConverter : ICoercesValueToBoolean
Constructors
| Improve this Doc View SourceBooleanValueConverter(IInterpretsExpressionResult)
Initializes a new instance of the BooleanValueConverter class.
Declaration
public BooleanValueConverter(IInterpretsExpressionResult resultInterpreter)
Parameters
Type | Name | Description |
---|---|---|
IInterpretsExpressionResult | resultInterpreter | Result interpreter. |
Methods
| Improve this Doc View SourceCoerceToBoolean(Object)
Gets the boolean representation of the specified value, for the purpose of a not
expression.
Declaration
public bool CoerceToBoolean(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value to test for 'truthiness'. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean representation of the |
Remarks
The ZPT standard states that the following values are treated as false
by a
not
expression.
- An instance of AbortZptActionToken.
- A null reference.
- The value System.Boolean
false
. - Any value where System.Object.Equals(System.Object, System.Object) treats that value as equal to zero.
- Empty enumerables, IE any object which implements System.Collections.IEnumerable which has no items.
All other values are treated as true
by the ZPT specification.