Class BuiltinContextsProvider
Provides the built-in contexts which are inherent to the TALES specification.
These are generally accessible as if they were root objects within a path expression.
If, for example, their names have been overwritten they may alternatively be referenced
explicitly with the CONTEXTS
reserved variable name.
Inheritance
Inherited Members
Namespace: ZptSharp.Expressions
Assembly: ZptSharp.dll
Syntax
public class BuiltinContextsProvider : IGetsDictionaryOfNamedTalesValues, IGetsNamedTalesValue
Remarks
This is the default implementation of the root contexts provider. If RootContextsProvider has not been overridden upon the configuration then this is the class which shall be used to provide the root contexts. A more in-depth treatment of the root contexts which are provided by this class is available in the separate writeup about global contexts.
If the configuration has been overridden and a different implementation chosen for the root contexts provider, then there might be a very different set of root contexts available, and not those described in the link above.
Constructors
| Improve this Doc View SourceBuiltinContextsProvider(ExpressionContext, RenderingConfig, IGetsMetalDocumentAdapter)
Initializes a new instance of the BuiltinContextsProvider class.
Declaration
public BuiltinContextsProvider(ExpressionContext context, RenderingConfig config, IGetsMetalDocumentAdapter metalDocumentAdapterFactory)
Parameters
Type | Name | Description |
---|---|---|
ExpressionContext | context | The rendering context. |
RenderingConfig | config | The configuration. |
IGetsMetalDocumentAdapter | metalDocumentAdapterFactory | A METAL document adapter factory. |
Fields
| Improve this Doc View SourceAttributes
An identifier/alias for getting the attributes from the current INode.
Declaration
public static readonly string Attributes
Field Value
Type | Description |
---|---|
System.String |
Container
An identifier/alias for getting the container of the current IDocument.
Declaration
public static readonly string Container
Field Value
Type | Description |
---|---|
System.String |
Default
An identifier/alias for an object which indicates that the current action should be cancelled.
Declaration
public static readonly string Default
Field Value
Type | Description |
---|---|
System.String |
Error
An identifier/alias for getting an error object which was encountered whilst processing a context.
Declaration
public static readonly string Error
Field Value
Type | Description |
---|---|
System.String |
Here
An identifier/alias for the model object contained within the expression context.
Declaration
public static readonly string Here
Field Value
Type | Description |
---|---|
System.String |
Nothing
An identifier/alias for a non-object. This translates to null
in C# applications.
Declaration
public static readonly string Nothing
Field Value
Type | Description |
---|---|
System.String |
Options
An identifier for the keyword-options presented to the rendering process.
Declaration
public static readonly string Options
Field Value
Type | Description |
---|---|
System.String |
Repeat
An identifier for the collection of named repetition-information objects available in the expression context.
Declaration
public static readonly string Repeat
Field Value
Type | Description |
---|---|
System.String |
Template
An identifier/alias for getting the IDocument
Declaration
public static readonly string Template
Field Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceGetAllNamedValues()
Gets a dictionary of every available named TALES value, exposed by the current instance.
Declaration
public virtual Task<IDictionary<string, object>> GetAllNamedValues()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IDictionary<System.String, System.Object>> | The named values. |
TryGetValueAsync(String, CancellationToken)
Attempts to get a value for a named reference, relative to the current instance.
Declaration
public virtual Task<GetValueResult> TryGetValueAsync(string name, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the value to retrieve. |
System.Threading.CancellationToken | cancellationToken | An optional cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<GetValueResult> | An object indicating whether a value was successfully retrieved or not, along with the retrieved value (if applicable). |