Class MacroUsageContextProcessor
A IProcessesExpressionContext which applies the METAL rendering process.
This begins with detection of the metal:use-macro
attribute.
Inheritance
Implements
Inherited Members
Namespace: ZptSharp.Metal
Assembly: ZptSharp.dll
Syntax
public class MacroUsageContextProcessor : IProcessesExpressionContext
Remarks
A metal:use-macro
attribute indicates that the current DOM node should be replaced by an
expanded METAL macro. The macro to use as the replacement is indicated via an expression which is the value
of the use-macro attribute.
Macro expansion is handled by the service IExpandsMacro. This includes both filling slots which are defined in the used macro and also performing macro extension, if applicable.
Constructors
| Improve this Doc View SourceMacroUsageContextProcessor(IGetsMetalAttributeSpecs, IGetsMacro, IExpandsMacro, ILogger<MacroUsageContextProcessor>, IReplacesNode)
Initializes a new instance of the MacroUsageContextProcessor class.
Declaration
public MacroUsageContextProcessor(IGetsMetalAttributeSpecs specProvider, IGetsMacro macroProvider, IExpandsMacro macroExpander, ILogger<MacroUsageContextProcessor> logger, IReplacesNode replacer)
Parameters
Type | Name | Description |
---|---|---|
IGetsMetalAttributeSpecs | specProvider | Attribute spec provider. |
IGetsMacro | macroProvider | Macro provider. |
IExpandsMacro | macroExpander | Macro expander. |
Microsoft.Extensions.Logging.ILogger<MacroUsageContextProcessor> | logger | A logger. |
IReplacesNode | replacer | The node replacer. |
Methods
| Improve this Doc View SourceProcessContextAsync(ExpressionContext, CancellationToken)
Processes the context using the rules defined within this object.
Declaration
public Task<ExpressionContextProcessingResult> ProcessContextAsync(ExpressionContext context, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
ExpressionContext | context | The context to process. |
System.Threading.CancellationToken | token | An optional cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ExpressionContextProcessingResult> | A result object indicating the outcome of processing. |