Show / Hide Table of Contents

Class MacroUsageContextProcessor

A IProcessesExpressionContext which applies the METAL rendering process. This begins with detection of the metal:use-macro attribute.

Inheritance
System.Object
MacroUsageContextProcessor
Implements
IProcessesExpressionContext
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 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 Source

MacroUsageContextProcessor(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 Source

ProcessContextAsync(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.

Implements

IProcessesExpressionContext
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX