Class CallCondition
Helper class for SpeechProcessorDependency that stores the condition of the associated call.
Inheritance
Namespace: Recognissimo
Assembly: Recognissimo.dll
Syntax
public class CallCondition
Constructors
CallCondition(Func<Boolean>)
Construct CallCondition from a predicate.
Declaration
public CallCondition(Func<bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Boolean> | predicate | Predicate function, the return value of which determines whether or not to execute the initialization task to which it is linked. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
Fields
Always
CallCondition that always allows to execute the associated call.
Declaration
public static readonly CallCondition Always
Field Value
Type | Description |
---|---|
CallCondition |
Once
CallCondition which allows to execute the associated call only once.
Declaration
public static readonly CallCondition Once
Field Value
Type | Description |
---|---|
CallCondition |
Methods
Aggregate(CallCondition[])
Aggregates multiple conditions into one.
Declaration
public static CallCondition Aggregate(CallCondition[] conditions)
Parameters
Type | Name | Description |
---|---|---|
CallCondition[] | conditions | Array of conditions. |
Returns
Type | Description |
---|---|
CallCondition | CallCondition instance. |
Check()
Check if the condition is satisfied.
Declaration
public bool Check()
Returns
Type | Description |
---|---|
System.Boolean | Value of underlying condition. |
ValueChanged<T>(Func<T>, Func<T, T, Boolean>)
Create CallCondition that allows to execute the associated call only
if the return value of dependencyGetter
changes.
Declaration
public static CallCondition ValueChanged<T>(Func<T> dependencyGetter, Func<T, T, bool> equalityComparer = null)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T> | dependencyGetter | Function, a change in the return value of which activates the CallCondition. |
System.Func<T, T, System.Boolean> | equalityComparer | Custom equality comparer. If null, System.Collections.Generic.EqualityComparer`1.Equals(`0,`0) is used. |
Returns
Type | Description |
---|---|
CallCondition | CallCondition instance. |
Type Parameters
Name | Description |
---|---|
T | Generic parameter of |