Class TalExpressionResultInterpreter
Implementation of IInterpretsExpressionResult which provides interpretations of expression results, following the rules of TAL.
Inheritance
Implements
Inherited Members
Namespace: ZptSharp.Tal
Assembly: ZptSharp.dll
Syntax
public class TalExpressionResultInterpreter : IInterpretsExpressionResult
Methods
| Improve this Doc View SourceCoerceResultToBoolean(Object)
Gets a value which is the boolean representation of the specified result, following the rules of boolean type coercion for ZPT. This is used by various TAL attributes to determine whether a value is 'truthy' or 'falsey'.
Declaration
public bool CoerceResultToBoolean(object expressionResult)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | expressionResult | An expression result. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Remarks
This method will return false if the expressionResult is equal
to the default of its data-type, otherwise it returns true.
For any data-type, the default of the type is what would be returned by default(T) for that
type T.
Examples
For System.String this method returns false if the value is null, otherwise
it returns true.
For System.Int32 this method returns false if the value is equal to zero, otherwise
it returns true.
DoesResultAbortTheAction(Object)
Gets a value which indicates whether or not the expression result cancels the current action. See also: AbortZptActionToken.
Declaration
public bool DoesResultAbortTheAction(object expressionResult)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | expressionResult | Expression result. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|