WX5.Flow Class Reference
This class is useful for parameter checking and codepaths incapsulation.
More...
List of all members.
Static Public Member Functions |
static void | Restrict (Exception e, params bool[] conditions) |
| Throws an exception in case when any of conditions is false.
|
static void | Restrict (params bool[] conditions) |
| Throws an AgrumentException in case when any of conditions is false.
|
static void | RestrictNull (params object[] objects) |
| Throws an AgrumentException in case when any of checked objects is NULL.
|
static bool | Execute (bool[] preConditions, Block block, params bool[] postConditions) |
| Executes a block of code with pre- and post-checks.
|
static void | Select< A > (FuncX< A, bool > selector, params Tuple2< A, Block >[] actions) |
| Selects and executes one of actions.
|
Detailed Description
This class is useful for parameter checking and codepaths incapsulation.
Member Function Documentation
static bool WX5.Flow.Execute |
( |
bool[] |
preConditions, |
|
|
Block |
block, |
|
|
params bool[] |
postConditions | |
|
) |
| | [static] |
Executes a block of code with pre- and post-checks.
- Parameters:
-
| preConditions | a list of pre-conditions |
| block | block of code |
| postConditions | a list of post-conditions |
- Returns:
- TRUE if all post-conditions are TRUE
static void WX5.Flow.Restrict |
( |
params bool[] |
conditions |
) |
[static] |
Throws an AgrumentException in case when any of conditions is false.
- Parameters:
-
| conditions | list of conditions |
static void WX5.Flow.Restrict |
( |
Exception |
e, |
|
|
params bool[] |
conditions | |
|
) |
| | [static] |
Throws an exception in case when any of conditions is false.
- Parameters:
-
| e | an exception to throw |
| conditions | list of conditions |
static void WX5.Flow.RestrictNull |
( |
params object[] |
objects |
) |
[static] |
Throws an AgrumentException in case when any of checked objects is NULL.
- Parameters:
-
| objects | list of objects to check |
static void WX5.Flow.Select< A > |
( |
FuncX< A, bool > |
selector, |
|
|
params Tuple2< A, Block >[] |
actions | |
|
) |
| | [static] |
Selects and executes one of actions.
- Template Parameters:
-
- Parameters:
-
| selector | action selector |
| actions | list of actions |