Class MetalDocumentAdapter
An adapter for an IDocument which allows it to be used as IProvidesMacros and IGetsNamedTalesValue.
Inheritance
System.Object
MetalDocumentAdapter
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ZptSharp.Metal
Assembly: ZptSharp.dll
Syntax
public class MetalDocumentAdapter : IProvidesMacros, IGetsNamedTalesValue
Constructors
| Improve this Doc View SourceMetalDocumentAdapter(IDocument, ISearchesForAttributes, IGetsMetalAttributeSpecs)
Initializes a new instance of the MetalDocumentAdapter class.
Declaration
public MetalDocumentAdapter(IDocument document, ISearchesForAttributes attributeSearcher, IGetsMetalAttributeSpecs specProvider)
Parameters
Type | Name | Description |
---|---|---|
IDocument | document | The document to be wrapped. |
ISearchesForAttributes | attributeSearcher | A service which will search for attributes. |
IGetsMetalAttributeSpecs | specProvider | A METAL attribute spec provider. |
Properties
| Improve this Doc View SourceDocument
Gets the document for the current instance.
Declaration
public IDocument Document { get; }
Property Value
Type | Description |
---|---|
IDocument |
SourceName
Gets the name of the source info for this template.
Declaration
public string SourceName { get; }
Property Value
Type | Description |
---|---|
System.String | The name of the source. |
Methods
| Improve this Doc View SourceGetMacros()
Gets a collection of all of the macros
Declaration
public IDictionary<string, MetalMacro> GetMacros()
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, MetalMacro> | The macros. |
TryGetValueAsync(String, CancellationToken)
Attempts to get a value for a named reference, relative to the current instance.
Declaration
public 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). |