Show / Hide Table of Contents

Interface ICoercesValueToBoolean

An object which converts a specified value to a boolean. Specifically, this uses rules unique to a TALES 'not' expression, and not the rules shared by CoerceResultToBoolean(Object).s

Namespace: ZptSharp.Expressions.NotExpressions
Assembly: ZptSharp.dll
Syntax
public interface ICoercesValueToBoolean

Methods

| Improve this Doc View Source

CoerceToBoolean(Object)

Gets the boolean representation of the specified value, for the purpose of a not expression.

Declaration
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 value.

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.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX