Class ConditionBuilder<TTuple>
Supports the Condition in building custom scenarios using true/false propositions.
Inheritance
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public class ConditionBuilder<TTuple>
where TTuple : Template
Type Parameters
Name | Description |
---|---|
TTuple | The type of the n-tuple representation of a Template. |
Properties
| Improve this DocConditionResult
Gets the current combined result of Initialize<TTuple, TValue>(TTuple, TValue, Func<TValue, Boolean>), And(Boolean) and Or(Boolean).
Declaration
public bool ConditionResult { get; }
Property Value
Type | Description |
---|---|
System.Boolean | The current combined result of Initialize<TTuple, TValue>(TTuple, TValue, Func<TValue, Boolean>), And(Boolean) and Or(Boolean). |
Methods
| Improve this DocAnd(Boolean)
Performs a a bitwise logical conjunction (AND) operation of ConditionResult and value
.
Declaration
public ConditionBuilder<TTuple> And(bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | The value of a condition that can be either |
Returns
Type | Description |
---|---|
ConditionBuilder<TTuple> | This instance with the result of ConditionResult AND |
And<TValue>(TValue, Func<TValue, Boolean>)
Performs a a bitwise logical conjunction (AND) operation of ConditionResult and the result of condition
.
Declaration
public ConditionBuilder<TTuple> And<TValue>(TValue value, Func<TValue, bool> condition)
Parameters
Type | Name | Description |
---|---|---|
TValue | value | The argument for |
System.Func<TValue, System.Boolean> | condition | The delegate that will evaluate |
Returns
Type | Description |
---|---|
ConditionBuilder<TTuple> | This instance with the result of ConditionResult AND |
Type Parameters
Name | Description |
---|---|
TValue | The type of the value for |
Invoke(Action<TTuple>, Action<TTuple>)
Invokes one of two expressions depending on the value of ConditionResult.
Declaration
public void Invoke(Action<TTuple> firstExpression, Action<TTuple> secondExpression)
Parameters
Type | Name | Description |
---|---|---|
System.Action<TTuple> | firstExpression | The delegate that is invoked when ConditionResult is |
System.Action<TTuple> | secondExpression | The delegate that is invoked when ConditionResult is |
InvokeWhenFalse(Action<TTuple>)
Invokes the expressions when ConditionResult is false
.
Declaration
public void InvokeWhenFalse(Action<TTuple> expression)
Parameters
Type | Name | Description |
---|---|---|
System.Action<TTuple> | expression | The delegate that is invoked when ConditionResult is |
InvokeWhenTrue(Action<TTuple>)
Invokes the expressions when ConditionResult is true
.
Declaration
public void InvokeWhenTrue(Action<TTuple> expression)
Parameters
Type | Name | Description |
---|---|---|
System.Action<TTuple> | expression | The delegate that is invoked when ConditionResult is |
Or(Boolean)
Performs a bitwise logical disjunction (OR) operation of ConditionResult and value
.
Declaration
public ConditionBuilder<TTuple> Or(bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | The value of a condition that can be either |
Returns
Type | Description |
---|---|
ConditionBuilder<TTuple> | This instance with the result of ConditionResult OR |
Or<TValue>(TValue, Func<TValue, Boolean>)
Performs a bitwise logical disjunction (OR) operation of ConditionResult and value
.
Declaration
public ConditionBuilder<TTuple> Or<TValue>(TValue value, Func<TValue, bool> condition)
Parameters
Type | Name | Description |
---|---|---|
TValue | value | The argument for |
System.Func<TValue, System.Boolean> | condition | The delegate that will evaluate |
Returns
Type | Description |
---|---|
ConditionBuilder<TTuple> | This instance with the result of ConditionResult OR |
Type Parameters
Name | Description |
---|---|
TValue | The type of the value for |