Class ExpressionContextIterativeProcessor
An implementation of IIterativelyProcessesExpressionContexts which receives its IProcessesExpressionContext from the constructor. See also: IGetsIterativeExpressionContextProcessor for a factory which may be used to create instances of this type.
Inheritance
Implements
Inherited Members
Namespace: ZptSharp.Rendering
Assembly: ZptSharp.dll
Syntax
public class ExpressionContextIterativeProcessor : IIterativelyProcessesExpressionContexts
Constructors
| Improve this Doc View SourceExpressionContextIterativeProcessor(IProcessesExpressionContext, IGetsChildExpressionContexts)
Initializes a new instance of the ExpressionContextIterativeProcessor class.
Declaration
public ExpressionContextIterativeProcessor(IProcessesExpressionContext contextProcessor, IGetsChildExpressionContexts childContextProvider)
Parameters
Type | Name | Description |
---|---|---|
IProcessesExpressionContext | contextProcessor | Context processor. |
IGetsChildExpressionContexts | childContextProvider | Child context provider. |
Methods
| Improve this Doc View SourceIterateContextAndChildrenAsync(ExpressionContext, CancellationToken)
Iterate over the specified context
, as well as all of its children.
Declaration
public Task IterateContextAndChildrenAsync(ExpressionContext context, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
ExpressionContext | context | The context over which to iterate. |
System.Threading.CancellationToken | token | An optional cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating when processing is complete. |
Remarks
This method uses an "open list" to store the contexts which are due to be processed; essentially a list of the contexts which must still be processed. After processing each context, further contexts may be added to the open list. There are two ways in which we find further contexts:
Conceptually, as an example, child contexts refer to child DOM nodes. Additional contexts are those which result from a processing operation. For example a 'repetition' operation might create several copies of a context, each one containing an iteration of a collection item from the model.