- Namespace
- Statiq
.Common - Interfaces
- Base Types
-
- object
- Module
- SyncModule
Syntax
public abstract class SyncParentModule : SyncModule, IModule, IEnumerable<IModule>, IEnumerable
Remarks
Implementing modules should be careful not to accept IEnumerable<T>
as a constructor
parameter because doing so and then passing an ParentModule
as a direct child could
add the modules from the child container module directly to the parent instead of adding the
actual child container module.
Implementing types should also provide an empty constructor to allow collection initialization syntax to work, or at least be sure that a constructor overload exists that does not require specifying child modules in the constructor.
It's also recommended that if a module accepts child modules they are guaranteed to always execute. If the child modules are only executed under certain conditions (like if a config delegate is not specified) then it's recommended the module be split into multiple modules, one of which is responsible for executing child modules.
Constructors
Name | Summary |
---|---|
SyncParentModule |
Creates a new container module with the specified child modules.
Any null items in the sequence of modules will be discarded.
|
Properties
Name | Property Type | Summary |
---|---|---|
Children | ModuleList |
The children of this module.
|
Methods
Name | Return Value | Summary |
---|---|---|
Add |
void |
Adds modules as a child of this module.
|
AfterExecution |
void |
Called after each module execution.
Inherited from Module
|
AfterExecutionAsync |
Task |
Called after each module execution.
Inherited from Module
|
BeforeExecution |
void |
Called before each module execution.
Inherited from Module
|
BeforeExecutionAsync |
Task |
Called before each module execution.
Inherited from Module
|
ExecuteAsync |
Task |
This should not be called directly, instead call
IExecutionContext.Execute() if you need to execute a module from within another module.
Inherited from Module
|
ExecuteContext |
IEnumerable |
Executes the module once for all input documents.
Inherited from SyncModule
|
ExecuteContextAsync |
Task |
Executes the module once for all input documents.
Inherited from SyncModule
|
ExecuteInput |
IEnumerable |
Executes the module.
Inherited from SyncModule
|
ExecuteInputAsync |
Task |
Executes the module.
Inherited from SyncModule
|
Finally |
void |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
FinallyAsync |
Task |
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
|
GetEnumerator |
IEnumerator |