Class ActionEx
Class containing some extension methods for System.Action.
Inheritance
Inherited Members
Namespace:Extend
Assembly:Extend.dll
Syntax
public static class ActionEx
Methods
| Improve this Doc View SourceExecuteIfAnyFalse(Action, Action, Boolean[])
Executes the specified action if one of the given Boolean values is false, otherwise it executes the specified true action, if one is specified.
Declaration
public static void ExecuteIfAnyFalse(this Action falseAction, Action trueAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action | falseAction | The action to execute if any of the given values is false. |
System.Action | trueAction | The action to execute if all of the given value is true. |
System.Boolean[] | values | The Boolean values to check. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfAnyFalse(Action, Boolean[])
Executes the specified action if one of the given Boolean values is false.
Declaration
public static void ExecuteIfAnyFalse(this Action falseAction, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action | falseAction | The action to execute if any of the given values is false. |
System.Boolean[] | values | The Boolean values to check. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfAnyFalse<T>(Action<T>, T, Action<T>, Boolean[])
Executes the specified action if one of the given Boolean values is false, otherwise it executes the specified true action, if one is specified.
Declaration
public static void ExecuteIfAnyFalse<T>(this Action<T> falseAction, T parameter, Action<T> trueAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T><T> | falseAction | The action to execute if any of the given values is false. |
T | parameter | The parameter to pass to the action with gets executed. |
System.Action<T><T> | trueAction | The action to execute if all values are true. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T | The type of the parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfAnyFalse<T>(Action<T>, T, Boolean[])
Executes the specified action if one of the given Boolean values is false.
Declaration
public static void ExecuteIfAnyFalse<T>(this Action<T> falseAction, T parameter, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T><T> | falseAction | The action to execute if any of the given values is false. |
T | parameter | The parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T | The type of the parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfAnyFalse<T1, T2>(Action<T1, T2>, T1, T2, Action<T1, T2>, Boolean[])
Executes the specified action if one of the given Boolean values is false, otherwise it executes the specified true action, if one is specified.
Declaration
public static void ExecuteIfAnyFalse<T1, T2>(this Action<T1, T2> falseAction, T1 parameter1, T2 parameter2, Action<T1, T2> trueAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2><T1, T2> | falseAction | The action to execute if any of the given values is false. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
System.Action<T1, T2><T1, T2> | trueAction | The action to execute if all values are true. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfAnyFalse<T1, T2>(Action<T1, T2>, T1, T2, Boolean[])
Executes the specified action if one of the given Boolean values is false.
Declaration
public static void ExecuteIfAnyFalse<T1, T2>(this Action<T1, T2> falseAction, T1 parameter1, T2 parameter2, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2><T1, T2> | falseAction | The action to execute if any of the given values is false. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfAnyFalse<T1, T2, T3>(Action<T1, T2, T3>, T1, T2, T3, Action<T1, T2, T3>, Boolean[])
Executes the specified action if one of the given Boolean values is false, otherwise it executes the specified true action, if one is specified.
Declaration
public static void ExecuteIfAnyFalse<T1, T2, T3>(this Action<T1, T2, T3> falseAction, T1 parameter1, T2 parameter2, T3 parameter3, Action<T1, T2, T3> trueAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3><T1, T2, T3> | falseAction | The action to execute if any of the given values is false. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
System.Action<T1, T2, T3><T1, T2, T3> | trueAction | The action to execute if all values are true. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfAnyFalse<T1, T2, T3>(Action<T1, T2, T3>, T1, T2, T3, Boolean[])
Executes the specified action if one of the given Boolean values is false.
Declaration
public static void ExecuteIfAnyFalse<T1, T2, T3>(this Action<T1, T2, T3> falseAction, T1 parameter1, T2 parameter2, T3 parameter3, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3><T1, T2, T3> | falseAction | The action to execute if any of the given values is false. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfAnyFalse<T1, T2, T3, T4>(Action<T1, T2, T3, T4>, T1, T2, T3, T4, Action<T1, T2, T3, T4>, Boolean[])
Executes the specified action if one of the given Boolean values is false, otherwise it executes the specified true action, if one is specified.
Declaration
public static void ExecuteIfAnyFalse<T1, T2, T3, T4>(this Action<T1, T2, T3, T4> falseAction, T1 parameter1, T2 parameter2, T3 parameter3, T4 parameter4, Action<T1, T2, T3, T4> trueAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4><T1, T2, T3, T4> | falseAction | The action to execute if any of the given values is false. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
T4 | parameter4 | The fourth parameter to pass to the action with gets executed. |
System.Action<T1, T2, T3, T4><T1, T2, T3, T4> | trueAction | The action to execute if all values are true. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
T4 | The type of the fourth parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfAnyFalse<T1, T2, T3, T4>(Action<T1, T2, T3, T4>, T1, T2, T3, T4, Boolean[])
Executes the specified action if one of the given Boolean values is false.
Declaration
public static void ExecuteIfAnyFalse<T1, T2, T3, T4>(this Action<T1, T2, T3, T4> falseAction, T1 parameter1, T2 parameter2, T3 parameter3, T4 parameter4, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4><T1, T2, T3, T4> | falseAction | The action to execute if any of the given values is false. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
T4 | parameter4 | The fourth parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
T4 | The type of the fourth parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfAnyTrue(Action, Action, Boolean[])
Executes the specified action if one of the given Boolean values is true, otherwise it executes the specified false action, if one is specified.
Declaration
public static void ExecuteIfAnyTrue(this Action trueAction, Action falseAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action | trueAction | The action to execute if one of the values is true. |
System.Action | falseAction | The action to execute if any of the given values is false. |
System.Boolean[] | values | The Boolean values to check. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | trueAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfAnyTrue(Action, Boolean[])
Executes the specified action if one of the given Boolean values is true.
Declaration
public static void ExecuteIfAnyTrue(this Action trueAction, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action | trueAction | The action to execute if one of the values is true. |
System.Boolean[] | values | The Boolean values to check. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | True action can not be null, if any value is true. |
ExecuteIfAnyTrue<T>(Action<T>, T, Action<T>, Boolean[])
Executes the specified action if one of the given Boolean values is true, otherwise it executes the specified false action, if one is specified.
Declaration
public static void ExecuteIfAnyTrue<T>(this Action<T> trueAction, T parameter, Action<T> falseAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T><T> | trueAction | The action to execute if one of the values is true. |
T | parameter | The parameter to pass to the action with gets executed. |
System.Action<T><T> | falseAction | The action to execute if any of the given values is false. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T | The type of the parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | True action can not be null, if any value is true. |
ExecuteIfAnyTrue<T>(Action<T>, T, Boolean[])
Executes the specified action if one of the given Boolean values is true.
Declaration
public static void ExecuteIfAnyTrue<T>(this Action<T> trueAction, T parameter, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T><T> | trueAction | The action to execute if one of the values is true. |
T | parameter | The parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T | The type of the parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | True action can not be null, if any value is true. |
ExecuteIfAnyTrue<T1, T2>(Action<T1, T2>, T1, T2, Action<T1, T2>, Boolean[])
Executes the specified action if one of the given Boolean values is true, otherwise it executes the specified false action, if one is specified.
Declaration
public static void ExecuteIfAnyTrue<T1, T2>(this Action<T1, T2> trueAction, T1 parameter1, T2 parameter2, Action<T1, T2> falseAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2><T1, T2> | trueAction | The action to execute if one of the values is true. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
System.Action<T1, T2><T1, T2> | falseAction | The action to execute if any of the given values is false. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | True action can not be null, if any value is true. |
ExecuteIfAnyTrue<T1, T2>(Action<T1, T2>, T1, T2, Boolean[])
Executes the specified action if one of the given Boolean values is true.
Declaration
public static void ExecuteIfAnyTrue<T1, T2>(this Action<T1, T2> trueAction, T1 parameter1, T2 parameter2, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2><T1, T2> | trueAction | The action to execute if one of the values is true. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | True action can not be null, if any value is true. |
ExecuteIfAnyTrue<T1, T2, T3>(Action<T1, T2, T3>, T1, T2, T3, Action<T1, T2, T3>, Boolean[])
Executes the specified action if one of the given Boolean values is true, otherwise it executes the specified false action, if one is specified.
Declaration
public static void ExecuteIfAnyTrue<T1, T2, T3>(this Action<T1, T2, T3> trueAction, T1 parameter1, T2 parameter2, T3 parameter3, Action<T1, T2, T3> falseAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3><T1, T2, T3> | trueAction | The action to execute if one of the values is true. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
System.Action<T1, T2, T3><T1, T2, T3> | falseAction | The action to execute if any of the given values is false. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | True action can not be null, if any value is true. |
ExecuteIfAnyTrue<T1, T2, T3>(Action<T1, T2, T3>, T1, T2, T3, Boolean[])
Executes the specified action if one of the given Boolean values is true.
Declaration
public static void ExecuteIfAnyTrue<T1, T2, T3>(this Action<T1, T2, T3> trueAction, T1 parameter1, T2 parameter2, T3 parameter3, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3><T1, T2, T3> | trueAction | The action to execute if one of the values is true. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | True action can not be null, if any value is true. |
ExecuteIfAnyTrue<T1, T2, T3, T4>(Action<T1, T2, T3, T4>, T1, T2, T3, T4, Action<T1, T2, T3, T4>, Boolean[])
Executes the specified action if one of the given Boolean values is true, otherwise it executes the specified false action, if one is specified.
Declaration
public static void ExecuteIfAnyTrue<T1, T2, T3, T4>(this Action<T1, T2, T3, T4> trueAction, T1 parameter1, T2 parameter2, T3 parameter3, T4 parameter4, Action<T1, T2, T3, T4> falseAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4><T1, T2, T3, T4> | trueAction | The action to execute if one of the values is true. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
T4 | parameter4 | The fourth parameter to pass to the action with gets executed. |
System.Action<T1, T2, T3, T4><T1, T2, T3, T4> | falseAction | The action to execute if any of the given values is false. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
T4 | The type of the fourth parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | True action can not be null, if any value is true. |
ExecuteIfAnyTrue<T1, T2, T3, T4>(Action<T1, T2, T3, T4>, T1, T2, T3, T4, Boolean[])
Executes the specified action if one of the given Boolean values is true.
Declaration
public static void ExecuteIfAnyTrue<T1, T2, T3, T4>(this Action<T1, T2, T3, T4> trueAction, T1 parameter1, T2 parameter2, T3 parameter3, T4 parameter4, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4><T1, T2, T3, T4> | trueAction | The action to execute if one of the values is true. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
T4 | parameter4 | The fourth parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
T4 | The type of the fourth parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | True action can not be null, if any value is true. |
ExecuteIfFalse(Action, Action, Boolean[])
Executes the specified action if the given Boolean values are false, otherwise it executes the specified true action, if one is specified.
Declaration
public static void ExecuteIfFalse(this Action falseAction, Action trueAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action | falseAction | The action to execute if the given values are false. |
System.Action | trueAction | The action to execute if any of the given values is true. |
System.Boolean[] | values | The Boolean values to check. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfFalse(Action, Boolean[])
Executes the specified action if the given Boolean values are false.
Declaration
public static void ExecuteIfFalse(this Action falseAction, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action | falseAction | The action to execute if the given values are false. |
System.Boolean[] | values | The Boolean values to check. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfFalse<T>(Action<T>, T, Action<T>, Boolean[])
Executes the specified action if the given Boolean values are false, otherwise it executes the specified true action, if one is specified.
Declaration
public static void ExecuteIfFalse<T>(this Action<T> falseAction, T parameter, Action<T> trueAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T><T> | falseAction | The action to execute if the given values are false. |
T | parameter | The parameter to pass to the action with gets executed. |
System.Action<T><T> | trueAction | The action to execute if any of the given values is true. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T | The type of the parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfFalse<T>(Action<T>, T, Boolean[])
Executes the specified action if the given Boolean values are false.
Declaration
public static void ExecuteIfFalse<T>(this Action<T> falseAction, T parameter, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T><T> | falseAction | The action to execute if the given values are false. |
T | parameter | The parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T | The type of the parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfFalse<T1, T2>(Action<T1, T2>, T1, T2, Action<T1, T2>, Boolean[])
Executes the specified action if the given Boolean values are false, otherwise it executes the specified true action, if one is specified.
Declaration
public static void ExecuteIfFalse<T1, T2>(this Action<T1, T2> falseAction, T1 parameter1, T2 parameter2, Action<T1, T2> trueAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2><T1, T2> | falseAction | The action to execute if the given values are false. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
System.Action<T1, T2><T1, T2> | trueAction | The action to execute if any of the given values is true. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfFalse<T1, T2>(Action<T1, T2>, T1, T2, Boolean[])
Executes the specified action if the given Boolean values are false.
Declaration
public static void ExecuteIfFalse<T1, T2>(this Action<T1, T2> falseAction, T1 parameter1, T2 parameter2, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2><T1, T2> | falseAction | The action to execute if the given values are false. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfFalse<T1, T2, T3>(Action<T1, T2, T3>, T1, T2, T3, Action<T1, T2, T3>, Boolean[])
Executes the specified action if the given Boolean values are false, otherwise it executes the specified true action, if one is specified.
Declaration
public static void ExecuteIfFalse<T1, T2, T3>(this Action<T1, T2, T3> falseAction, T1 parameter1, T2 parameter2, T3 parameter3, Action<T1, T2, T3> trueAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3><T1, T2, T3> | falseAction | The action to execute if the given values are false. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
System.Action<T1, T2, T3><T1, T2, T3> | trueAction | The action to execute if any of the given values is true. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfFalse<T1, T2, T3>(Action<T1, T2, T3>, T1, T2, T3, Boolean[])
Executes the specified action if the given Boolean values are false.
Declaration
public static void ExecuteIfFalse<T1, T2, T3>(this Action<T1, T2, T3> falseAction, T1 parameter1, T2 parameter2, T3 parameter3, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3><T1, T2, T3> | falseAction | The action to execute if the given values are false. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfFalse<T1, T2, T3, T4>(Action<T1, T2, T3, T4>, T1, T2, T3, T4, Action<T1, T2, T3, T4>, Boolean[])
Executes the specified action if the given Boolean values are false, otherwise it executes the specified true action, if one is specified.
Declaration
public static void ExecuteIfFalse<T1, T2, T3, T4>(this Action<T1, T2, T3, T4> falseAction, T1 parameter1, T2 parameter2, T3 parameter3, T4 parameter4, Action<T1, T2, T3, T4> trueAction = null, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4><T1, T2, T3, T4> | falseAction | The action to execute if the given values are false. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
T4 | parameter4 | The fourth parameter to pass to the action with gets executed. |
System.Action<T1, T2, T3, T4><T1, T2, T3, T4> | trueAction | The action to execute if any of the given values is true. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
T4 | The type of the fourth parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfFalse<T1, T2, T3, T4>(Action<T1, T2, T3, T4>, T1, T2, T3, T4, Boolean[])
Executes the specified action if the given Boolean values are false.
Declaration
public static void ExecuteIfFalse<T1, T2, T3, T4>(this Action<T1, T2, T3, T4> falseAction, T1 parameter1, T2 parameter2, T3 parameter3, T4 parameter4, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4><T1, T2, T3, T4> | falseAction | The action to execute if the given values are false. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
T4 | parameter4 | The fourth parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
T4 | The type of the fourth parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | falseAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfTrue(Action, Action, Boolean[])
Executes the specified action if the given Boolean values are true, otherwise it executes the specified false action, if one is specified.
Declaration
public static void ExecuteIfTrue(this Action trueAction, Action falseAction, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action | trueAction | The action to execute if the given values are true. |
System.Action | falseAction | The action to execute if any of the given values is false. |
System.Boolean[] | values | The Boolean values to check. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | trueAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfTrue(Action, Boolean[])
Executes the specified action if the given Boolean values are true.
Declaration
public static void ExecuteIfTrue(this Action trueAction, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action | trueAction | The action to execute if the given values are true. |
System.Boolean[] | values | The Boolean values to check. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | trueAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfTrue<T>(Action<T>, T, Action<T>, Boolean[])
Executes the specified action if the given Boolean values are true, otherwise it executes the specified false action, if one is specified.
Declaration
public static void ExecuteIfTrue<T>(this Action<T> trueAction, T parameter, Action<T> falseAction, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T><T> | trueAction | The action to execute if the given values are true. |
T | parameter | The parameter to pass to the action with gets executed. |
System.Action<T><T> | falseAction | The action to execute if any of the given values is false. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T | The type of the parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | trueAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfTrue<T>(Action<T>, T, Boolean[])
Executes the specified action if the given Boolean values are true.
Declaration
public static void ExecuteIfTrue<T>(this Action<T> trueAction, T parameter, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T><T> | trueAction | The action to execute if the given values are true. |
T | parameter | The parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T | The type of the parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | trueAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfTrue<T1, T2>(Action<T1, T2>, T1, T2, Action<T1, T2>, Boolean[])
Executes the specified action if the given Boolean values are true, otherwise it executes the specified false action, if one is specified.
Declaration
public static void ExecuteIfTrue<T1, T2>(this Action<T1, T2> trueAction, T1 parameter1, T2 parameter2, Action<T1, T2> falseAction, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2><T1, T2> | trueAction | The action to execute if the given values are true. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
System.Action<T1, T2><T1, T2> | falseAction | The action to execute if any of the given values is false. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | trueAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfTrue<T1, T2>(Action<T1, T2>, T1, T2, Boolean[])
Executes the specified action if the given Boolean values are true.
Declaration
public static void ExecuteIfTrue<T1, T2>(this Action<T1, T2> trueAction, T1 parameter1, T2 parameter2, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2><T1, T2> | trueAction | The action to execute if the given values are true. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | trueAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfTrue<T1, T2, T3>(Action<T1, T2, T3>, T1, T2, T3, Action<T1, T2, T3>, Boolean[])
Executes the specified action if the given Boolean values are true, otherwise it executes the specified false action, if one is specified.
Declaration
public static void ExecuteIfTrue<T1, T2, T3>(this Action<T1, T2, T3> trueAction, T1 parameter1, T2 parameter2, T3 parameter3, Action<T1, T2, T3> falseAction, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3><T1, T2, T3> | trueAction | The action to execute if the given values are true. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
System.Action<T1, T2, T3><T1, T2, T3> | falseAction | The action to execute if any of the given values is false. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | trueAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfTrue<T1, T2, T3>(Action<T1, T2, T3>, T1, T2, T3, Boolean[])
Executes the specified action if the given Boolean values are true.
Declaration
public static void ExecuteIfTrue<T1, T2, T3>(this Action<T1, T2, T3> trueAction, T1 parameter1, T2 parameter2, T3 parameter3, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3><T1, T2, T3> | trueAction | The action to execute if the given values are true. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | trueAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfTrue<T1, T2, T3, T4>(Action<T1, T2, T3, T4>, T1, T2, T3, T4, Action<T1, T2, T3, T4>, Boolean[])
Executes the specified action if the given Boolean values are true, otherwise it executes the specified false action, if one is specified.
Declaration
public static void ExecuteIfTrue<T1, T2, T3, T4>(this Action<T1, T2, T3, T4> trueAction, T1 parameter1, T2 parameter2, T3 parameter3, T4 parameter4, Action<T1, T2, T3, T4> falseAction, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4><T1, T2, T3, T4> | trueAction | The action to execute if the given values are true. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
T4 | parameter4 | The fourth parameter to pass to the action with gets executed. |
System.Action<T1, T2, T3, T4><T1, T2, T3, T4> | falseAction | The action to execute if any of the given values is false. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
T4 | The type of the fourth parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | trueAction can not be null. |
System.ArgumentNullException | values can not be null. |
ExecuteIfTrue<T1, T2, T3, T4>(Action<T1, T2, T3, T4>, T1, T2, T3, T4, Boolean[])
Executes the specified action if the given Boolean values are true.
Declaration
public static void ExecuteIfTrue<T1, T2, T3, T4>(this Action<T1, T2, T3, T4> trueAction, T1 parameter1, T2 parameter2, T3 parameter3, T4 parameter4, params bool[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4><T1, T2, T3, T4> | trueAction | The action to execute if the given values are true. |
T1 | parameter1 | The first parameter to pass to the action with gets executed. |
T2 | parameter2 | The second parameter to pass to the action with gets executed. |
T3 | parameter3 | The third parameter to pass to the action with gets executed. |
T4 | parameter4 | The fourth parameter to pass to the action with gets executed. |
System.Boolean[] | values | The Boolean values to check. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
T4 | The type of the fourth parameter. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | trueAction can not be null. |
System.ArgumentNullException | values can not be null. |
SafeExecute(Action)
Executes the given action inside of a try catch block and catches all exceptions.
Declaration
public static bool SafeExecute(this Action action)
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The action to execute. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the action was executed without an exception, otherwise false. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | action can not be null. |
SafeExecute(Action, Type[])
Executes the given action inside of a try catch block. Catches all exception types contained in the given list of exception types.
Declaration
public static bool SafeExecute(this Action action, params Type[] exceptionsToCatch)
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The action to execute. |
System.Type[] | exceptionsToCatch | A list of exception types to catch. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the action was executed without an exception, otherwise false. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | action can not be null. |
System.ArgumentNullException | exceptionsToCatch can not be null. |
SafeExecute<TException>(Action)
Executes the given action inside of a try catch block. Catches exceptions of the given type.
Declaration
public static bool SafeExecute<TException>(this Action action)where TException : Exception
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The action to execute. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the action was executed without an exception, otherwise false. |
Type Parameters
Name | Description |
---|---|
TException | The type of the exception. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | action can not be null. |
SafeExecute<TException1, TException2>(Action)
Executes the given action inside of a try catch block. Catches exceptions of the given types.
Declaration
public static bool SafeExecute<TException1, TException2>(this Action action)where TException1 : Exception where TException2 : Exception
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The action to execute. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the action was executed without an exception, otherwise false. |
Type Parameters
Name | Description |
---|---|
TException1 | The first exception type to catch. |
TException2 | The second exception type to catch. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | action can not be null. |
SafeExecute<TException1, TException2, TException3>(Action)
Executes the given action inside of a try catch block. Catches exceptions of the given types.
Declaration
public static bool SafeExecute<TException1, TException2, TException3>(this Action action)where TException1 : Exception where TException2 : Exception where TException3 : Exception
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The action to execute. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the action was executed without an exception, otherwise false. |
Type Parameters
Name | Description |
---|---|
TException1 | The first exception type to catch. |
TException2 | The second exception type to catch. |
TException3 | The third exception type to catch. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | action can not be null. |
SafeExecute<TException1, TException2, TException3, TException4>(Action)
Executes the given action inside of a try catch block. Catches exceptions of the given types.
Declaration
public static bool SafeExecute<TException1, TException2, TException3, TException4>(this Action action)where TException1 : Exception where TException2 : Exception where TException3 : Exception where TException4 : Exception
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The action to execute. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the action was executed without an exception, otherwise false. |
Type Parameters
Name | Description |
---|---|
TException1 | The first exception type to catch. |
TException2 | The second exception type to catch. |
TException3 | The third exception type to catch. |
TException4 | The fourth exception type to catch. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | action can not be null. |
SafeExecuteExcept(Action, Type[])
Executes the given action inside of a try catch block and catches all exception expect the given ones.
Declaration
public static bool SafeExecuteExcept(this Action action, params Type[] exceptionsToThrow)
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The action to execute. |
System.Type[] | exceptionsToThrow | The exceptions to throw. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the action was executed without an exception, otherwise false. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | action can not be null. |
System.ArgumentNullException | exceptionsToThrow can not be null. |
SafeExecuteExcept<TException>(Action)
Executes the given action inside of a try catch block and catches all exception expect the specified type.
Declaration
public static bool SafeExecuteExcept<TException>(this Action action)where TException : Exception
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The action to execute. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the action was executed without an exception, otherwise false. |
Type Parameters
Name | Description |
---|---|
TException | The type of the exception to throw. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | action can not be null. |
SafeExecuteExcept<TException1, TException2>(Action)
Executes the given action inside of a try catch block and catches all exception expect the specified types.
Declaration
public static bool SafeExecuteExcept<TException1, TException2>(this Action action)where TException1 : Exception where TException2 : Exception
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The action to execute. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the action was executed without an exception, otherwise false. |
Type Parameters
Name | Description |
---|---|
TException1 | The first exception type to throw. |
TException2 | The second exception type to throw. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | action can not be null. |
SafeExecuteExcept<TException1, TException2, TException3>(Action)
Executes the given action inside of a try catch block and catches all exception expect the specified types.
Declaration
public static bool SafeExecuteExcept<TException1, TException2, TException3>(this Action action)where TException1 : Exception where TException2 : Exception where TException3 : Exception
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The action to execute. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the action was executed without an exception, otherwise false. |
Type Parameters
Name | Description |
---|---|
TException1 | The first exception type to throw. |
TException2 | The second exception type to throw. |
TException3 | The third exception type to throw. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | action can not be null. |
SafeExecuteExcept<TException1, TException2, TException3, TException4>(Action)
Executes the given action inside of a try catch block and catches all exception expect the specified types.
Declaration
public static bool SafeExecuteExcept<TException1, TException2, TException3, TException4>(this Action action)where TException1 : Exception where TException2 : Exception where TException3 : Exception where TException4 : Exception
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | The action to execute. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the action was executed without an exception, otherwise false. |
Type Parameters
Name | Description |
---|---|
TException1 | The first exception type to throw. |
TException2 | The second exception type to throw. |
TException3 | The third exception type to throw. |
TException4 | The fourth exception type to throw. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | action can not be null. |