Summary
Evaluates a series of child modules for each input document if a specified condition is met.
- Assembly
- Wyam
.Core .dll - Namespace
- Wyam
.Core .Modules .Control - Interfaces
-
- IModule
- IList
<IfCondition>
- Base Types
-
- Object
graph BT
Type-->Base0["Object"]
Type-.->Interface0["IModule"]
click Interface0 "/api/Wyam.Common.Modules/IModule"
Type-.->Interface1["IList<IfCondition>"]
Type["If"]
class Type type-node
Syntax
public class If : IModule, IList<IfCondition>
Remarks
Any result documents from the child modules will be returned as the result of the
this module. Any input documents that don't match a predicate will be returned as
outputs without modification.
Constructors
Name | Summary |
---|---|
If |
Specifies a predicate and a series of child modules to be evaluated if the predicate returns true .
The predicate will be evaluated once for all input documents.
|
If |
Specifies a predicate and a series of child modules to be evaluated if the predicate returns true .
The predicate will be evaluated against every input document individually.
|
Properties
Name | Value | Summary |
---|---|---|
Count | int | |
IsReadOnly | bool | |
this[int] | IfCondition |
Methods
Name | Value | Summary |
---|---|---|
Add |
void | |
Clear |
void | |
Contains |
bool | |
CopyTo |
void | |
Else |
IModule |
This should be at the end of your fluent method chain and will evaluate the
specified child modules on all documents that did not satisfy previous predicates.
The predicate will be evaluated against every input document individually.
|
ElseIf |
If |
Specifies an alternate condition to be tested on documents that did not satisfy
previous conditions. You can chain together as many
ElseIf calls as needed.
The predicate will be evaluated once for all input documents.
|
ElseIf |
If |
Specifies an alternate condition to be tested on documents that did not satisfy
previous conditions. You can chain together as many
ElseIf calls as needed.
The predicate will be evaluated against every input document individually.
|
Execute |
IEnumerable |
This should not be called directly, instead call
IExecutionContext.Execute() if you need to execute a module from within another module.
|
GetEnumerator |
IEnumerator |
|
IndexOf |
int | |
Insert |
void | |
Remove |
bool | |
RemoveAt |
void | |
Without |
If |
The default behavior of this module is to "fall through" any documents that
didn't match one of the conditions and add it to the result set. This method
allows you to change that behavior and prevent unmatched documents from being
added to the result set.
|