ExecuteIfAnyFalseΒΆ

Executes the specified action if one of the given Boolean values is false, otherwise it executes the specified true action, if one is specified.

public static void ExecuteIfAnyFalse(
    this Action falseAction,
    Action trueAction,
    params Boolean[] values
)

Parameters

falseAction
The action to execute if any of the given values is false.
trueAction
The action to execute if all values are true.
values
The Boolean values to check.

Exceptions

False action can not be null, if any of the values is false.

Example

Action falseAction = () => Console.WriteLine("False Action");
Action trueAction = () => Console.WriteLine("True Action");

falseAction.ExecuteIfAnyFalse(trueAction, false, true, true);
falseAction.ExecuteIfAnyFalse(false);
falseAction.ExecuteIfAnyFalse(trueAction, true, true);

/*
 * The example displays the following output to the console:
 * False Action
 * False Action
 * True Action
 */

Executes the specified action if one of the given Boolean values is false, otherwise it executes the specified true action, if one is specified.

 public static void ExecuteIfAnyFalse<T>(
     this Action<T> falseAction,
     T parameter,
     Action<T> trueAction,
     params Boolean[] values
)

Parameters

falseAction
The action to execute if any of the given values is false.
parameter
Type: T
The parameter to pass to the action with gets executed.
trueAction
The action to execute if all values are true.
values
The Boolean values to check.

Exceptions

False action can not be null, if any of the values is false.
Action falseAction = () => Console.WriteLine("False Action");
Action trueAction = () => Console.WriteLine("True Action");

falseAction.ExecuteIfAnyFalse(trueAction, false, true, true);
falseAction.ExecuteIfAnyFalse(false);
falseAction.ExecuteIfAnyFalse(trueAction, true, true);

/*
 * The example displays the following output to the console:
 * False Action
 * False Action
 * True Action
 */

Executes the specified action if one of the given Boolean values is false, otherwise it executes the specified true action, if one is specified.

 public static void ExecuteIfAnyFalse<T>(
     this Action<T> falseAction,
     T parameter,
     Action<T> trueAction,
     params Boolean[] values
)

Parameters

falseAction
The action to execute if any of the given values is false.
parameter
Type: T
The parameter to pass to the action with gets executed.
trueAction
The action to execute if all values are true.
values
The Boolean values to check.

Exceptions

False action can not be null, if any of the values is false.
Action falseAction = () => Console.WriteLine("False Action");
Action trueAction = () => Console.WriteLine("True Action");

falseAction.ExecuteIfAnyFalse(trueAction, false, true, true);
falseAction.ExecuteIfAnyFalse(false);
falseAction.ExecuteIfAnyFalse(trueAction, true, true);

/*
 * The example displays the following output to the console:
 * False Action
 * False Action
 * True Action
 */

Executes the specified action if one of the given Boolean values is false, otherwise it executes the specified true action, if one is specified.

 public static void ExecuteIfAnyFalse<T>(
     this Action<T> falseAction,
     T parameter,
     Action<T> trueAction,
     params Boolean[] values
)

Parameters

falseAction
The action to execute if any of the given values is false.
parameter
Type: T
The parameter to pass to the action with gets executed.
trueAction
The action to execute if all values are true.
values
The Boolean values to check.

Exceptions

False action can not be null, if any of the values is false.
Action falseAction = () => Console.WriteLine("False Action");
Action trueAction = () => Console.WriteLine("True Action");

falseAction.ExecuteIfAnyFalse(trueAction, false, true, true);
falseAction.ExecuteIfAnyFalse(false);
falseAction.ExecuteIfAnyFalse(trueAction, true, true);

/*
 * The example displays the following output to the console:
 * False Action
 * False Action
 * True Action
 */