Class TemplateDirectoryValueProvider
A chain of responsibility class which get values from an objects of type TemplateDirectory. If the input object is a template directory then the output will either be a ZPT document adapter created via IGetsMetalDocumentAdapter, or it will be another template directory (representing directory traversal) or an exception will be raised.
Inheritance
Implements
Inherited Members
Namespace: ZptSharp.Expressions.PathExpressions
Assembly: ZptSharp.dll
Syntax
public class TemplateDirectoryValueProvider : IGetsValueFromObject
Constructors
| Improve this Doc View SourceTemplateDirectoryValueProvider(IGetsValueFromObject, IReadsAndWritesDocument, RenderingConfig, IGetsMetalDocumentAdapter)
Initializes a new instance of the DynamicObjectValueProvider class.
Declaration
public TemplateDirectoryValueProvider(IGetsValueFromObject wrapped, IReadsAndWritesDocument readerWriter, RenderingConfig config, IGetsMetalDocumentAdapter adapterFactory)
Parameters
Type | Name | Description |
---|---|---|
IGetsValueFromObject | wrapped | Wrapped. |
IReadsAndWritesDocument | readerWriter | A document reader/writer. |
RenderingConfig | config | The rendering configuration. |
IGetsMetalDocumentAdapter | adapterFactory | A METAL document adapter factory. |
Methods
| Improve this Doc View SourceTryGetValueAsync(String, Object, CancellationToken)
Attempts to get a value for a named reference, from the specified object.
Declaration
public Task<GetValueResult> TryGetValueAsync(string name, object object, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The value name. |
System.Object | object | The object from which to retrieve the value. |
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). |