Class AbortZptActionToken
An object which indicates that the current ZPT action should be cancelled/aborted.
Inheritance
Implements
Inherited Members
Namespace: ZptSharp.Expressions
Assembly: ZptSharp.Abstractions.dll
Syntax
public sealed class AbortZptActionToken : IEquatable<AbortZptActionToken>
Remarks
This object is used only as the return from EvaluateExpressionAsync(String, ExpressionContext, CancellationToken), when an expression wishes to indicate to ZptSharp that the current operation should be aborted.
Each TAL operation reacts differently to receiving this object as the result of an expression.
As a rule of thumb though, when an expression results in an instance of this object, the TAL
operation will attempt to avoid altering the source document.
For example, a tal:content
attribute would abort changing the content of the element if the
attribute value evaluates to an instance of this type.
In that case, the original content from the source file would be left in-place, as if the
tal:content
attribute had not been present at all.
Whilst it is possible to construct new instances of this type, because it has no state and is sealed, it is pointless to do so. All instances of this type are considered equal and will all produce the same hash codes. It is recommended to use Instance in order to refer to this object.
Properties
| Improve this Doc View SourceInstance
Gets a default/singleton instance of the abort-action token. For clarity, this is the recommended way to get a reference to this type.
Declaration
public static AbortZptActionToken Instance { get; }
Property Value
Type | Description |
---|---|
AbortZptActionToken | The instance. |
Methods
| Improve this Doc View SourceEquals(Object)
Determines whether the specified System.Object is equal to the current AbortZptActionToken.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with the current AbortZptActionToken. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Remarks
Any instance of AbortZptActionToken is considered equal to any other instance of AbortZptActionToken by this method. This type is not considered equal to any instance of any other type, though.
Equals(AbortZptActionToken)
Determines whether the specified AbortZptActionToken is equal to the current AbortZptActionToken.
Declaration
public bool Equals(AbortZptActionToken other)
Parameters
Type | Name | Description |
---|---|---|
AbortZptActionToken | other | The AbortZptActionToken to compare with the current AbortZptActionToken. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
All instances of AbortZptActionToken are considered equal by this method.
GetHashCode()
Serves as a hash function for a AbortZptActionToken object.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table. |
Overrides
Remarks
This method returns a hard-coded hash code of zero. This means that all instances of this type will always return the same hash code. This type is not suitable for use as the key of a hash table.