Class LoopUtility
Provides support for a generic way of specifying loops while providing ways to encapsulate and re-use existing code.
Inheritance
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public static class LoopUtility
Methods
| Improve this DocCondition<T>(T, RelationalOperator, T)
Provides a default implementation of a for-condition callback method.
Declaration
public static bool Condition<T>(T current, RelationalOperator relational, T repeats)
where T : struct, IComparable<T>, IEquatable<T>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
T | current | The current value of the counter in a for-loop. |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply as the relational operator for left-hand operand |
T | repeats | The amount of repeats to do according to the rules specified by |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T | The type of the counter in a for-loop. |
For<TSource>(TSource, RelationalOperator, TSource, AssignmentOperator, TSource, Action<TSource>)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T).
Declaration
public static void For<TSource>(TSource initial, RelationalOperator relational, TSource repeats, AssignmentOperator assignment, TSource step, Action<TSource> method)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
AssignmentOperator | assignment | One of the enumeration values that specifies the rules to apply for the |
TSource | step | The value to assign the |
System.Action<TSource> | method | The delegate that is invoked once per iteration. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource>(TSource, RelationalOperator, TSource, Action<TSource>)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T), where the latter is initialized to increment counter
by 1 on each iteration.
Declaration
public static void For<TSource>(TSource initial, RelationalOperator relational, TSource repeats, Action<TSource> method)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
System.Action<TSource> | method | The delegate that is invoked once per iteration. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource>(TSource, Action<TSource>)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T), where the former is initialized to set counter
with an initial value of 0 and applying relational rule LessThan and the latter is initialized to increment counter
by 1 on each iteration.
Declaration
public static void For<TSource>(TSource repeats, Action<TSource> method)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | repeats | The amount of repeats to do. |
System.Action<TSource> | method | The delegate that is invoked once per iteration. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource>(Func<TSource, RelationalOperator, TSource, Boolean>, TSource, RelationalOperator, TSource, Func<TSource, AssignmentOperator, TSource, TSource>, AssignmentOperator, TSource, Action<TSource>)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void For<TSource>(Func<TSource, RelationalOperator, TSource, bool> condition, TSource initial, RelationalOperator relational, TSource repeats, Func<TSource, AssignmentOperator, TSource, TSource> iterator, AssignmentOperator assignment, TSource step, Action<TSource> method)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
System.Func<TSource, RelationalOperator, TSource, System.Boolean> | condition | The condition delegate of the for-loop that is invoked once per iteration and determines the outcome of the conditional ruleset. |
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
System.Func<TSource, AssignmentOperator, TSource, TSource> | iterator | The iterator delegate of the for-loop that is invoked once per iteration and controls the steps of the |
AssignmentOperator | assignment | One of the enumeration values that specifies the rules to apply for the |
TSource | step | The value to assign the |
System.Action<TSource> | method | The delegate that is invoked once per iteration. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T>(TSource, RelationalOperator, TSource, AssignmentOperator, TSource, Action<TSource, T>, T)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T).
Declaration
public static void For<TSource, T>(TSource initial, RelationalOperator relational, TSource repeats, AssignmentOperator assignment, TSource step, Action<TSource, T> method, T arg)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
AssignmentOperator | assignment | One of the enumeration values that specifies the rules to apply for the |
TSource | step | The value to assign the |
System.Action<TSource, T> | method | The delegate that is invoked once per iteration. |
T | arg | The first parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T | The type of the parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T>(TSource, RelationalOperator, TSource, Action<TSource, T>, T)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T), where the latter is initialized to increment counter
by 1 on each iteration.
Declaration
public static void For<TSource, T>(TSource initial, RelationalOperator relational, TSource repeats, Action<TSource, T> method, T arg)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
System.Action<TSource, T> | method | The delegate that is invoked once per iteration. |
T | arg | The parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T | The type of the parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T>(TSource, Action<TSource, T>, T)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T), where the former is initialized to set counter
with an initial value of 0 and applying relational rule LessThan and the latter is initialized to increment counter
by 1 on each iteration.
Declaration
public static void For<TSource, T>(TSource repeats, Action<TSource, T> method, T arg)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | repeats | The amount of repeats to do. |
System.Action<TSource, T> | method | The delegate that is invoked once per iteration. |
T | arg | The parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T | The type of the parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T>(Func<TSource, RelationalOperator, TSource, Boolean>, TSource, RelationalOperator, TSource, Func<TSource, AssignmentOperator, TSource, TSource>, AssignmentOperator, TSource, Action<TSource, T>, T)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void For<TSource, T>(Func<TSource, RelationalOperator, TSource, bool> condition, TSource initial, RelationalOperator relational, TSource repeats, Func<TSource, AssignmentOperator, TSource, TSource> iterator, AssignmentOperator assignment, TSource step, Action<TSource, T> method, T arg)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
System.Func<TSource, RelationalOperator, TSource, System.Boolean> | condition | The condition delegate of the for-loop that is invoked once per iteration and determines the outcome of the conditional ruleset. |
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
System.Func<TSource, AssignmentOperator, TSource, TSource> | iterator | The iterator delegate of the for-loop that is invoked once per iteration and controls the steps of the |
AssignmentOperator | assignment | One of the enumeration values that specifies the rules to apply for the |
TSource | step | The value to assign the |
System.Action<TSource, T> | method | The delegate that is invoked once per iteration. |
T | arg | The parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T | The type of the parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2>(TSource, RelationalOperator, TSource, AssignmentOperator, TSource, Action<TSource, T1, T2>, T1, T2)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T).
Declaration
public static void For<TSource, T1, T2>(TSource initial, RelationalOperator relational, TSource repeats, AssignmentOperator assignment, TSource step, Action<TSource, T1, T2> method, T1 arg1, T2 arg2)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
AssignmentOperator | assignment | One of the enumeration values that specifies the rules to apply for the |
TSource | step | The value to assign the |
System.Action<TSource, T1, T2> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2>(TSource, RelationalOperator, TSource, Action<TSource, T1, T2>, T1, T2)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T), where the latter is initialized to increment counter
by 1 on each iteration.
Declaration
public static void For<TSource, T1, T2>(TSource initial, RelationalOperator relational, TSource repeats, Action<TSource, T1, T2> method, T1 arg1, T2 arg2)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
System.Action<TSource, T1, T2> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2>(TSource, Action<TSource, T1, T2>, T1, T2)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T), where the former is initialized to set counter
with an initial value of 0 and applying relational rule LessThan and the latter is initialized to increment counter
by 1 on each iteration.
Declaration
public static void For<TSource, T1, T2>(TSource repeats, Action<TSource, T1, T2> method, T1 arg1, T2 arg2)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | repeats | The amount of repeats to do. |
System.Action<TSource, T1, T2> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2>(Func<TSource, RelationalOperator, TSource, Boolean>, TSource, RelationalOperator, TSource, Func<TSource, AssignmentOperator, TSource, TSource>, AssignmentOperator, TSource, Action<TSource, T1, T2>, T1, T2)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void For<TSource, T1, T2>(Func<TSource, RelationalOperator, TSource, bool> condition, TSource initial, RelationalOperator relational, TSource repeats, Func<TSource, AssignmentOperator, TSource, TSource> iterator, AssignmentOperator assignment, TSource step, Action<TSource, T1, T2> method, T1 arg1, T2 arg2)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
System.Func<TSource, RelationalOperator, TSource, System.Boolean> | condition | The condition delegate of the for-loop that is invoked once per iteration and determines the outcome of the conditional ruleset. |
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
System.Func<TSource, AssignmentOperator, TSource, TSource> | iterator | The iterator delegate of the for-loop that is invoked once per iteration and controls the steps of the |
AssignmentOperator | assignment | One of the enumeration values that specifies the rules to apply for the |
TSource | step | The value to assign the |
System.Action<TSource, T1, T2> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2, T3>(TSource, RelationalOperator, TSource, AssignmentOperator, TSource, Action<TSource, T1, T2, T3>, T1, T2, T3)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T).
Declaration
public static void For<TSource, T1, T2, T3>(TSource initial, RelationalOperator relational, TSource repeats, AssignmentOperator assignment, TSource step, Action<TSource, T1, T2, T3> method, T1 arg1, T2 arg2, T3 arg3)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
AssignmentOperator | assignment | One of the enumeration values that specifies the rules to apply for the |
TSource | step | The value to assign the |
System.Action<TSource, T1, T2, T3> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2, T3>(TSource, RelationalOperator, TSource, Action<TSource, T1, T2, T3>, T1, T2, T3)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T), where the latter is initialized to increment counter
by 1 on each iteration.
Declaration
public static void For<TSource, T1, T2, T3>(TSource initial, RelationalOperator relational, TSource repeats, Action<TSource, T1, T2, T3> method, T1 arg1, T2 arg2, T3 arg3)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
System.Action<TSource, T1, T2, T3> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2, T3>(TSource, Action<TSource, T1, T2, T3>, T1, T2, T3)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T), where the former is initialized to set counter
with an initial value of 0 and applying relational rule LessThan and the latter is initialized to increment counter
by 1 on each iteration.
Declaration
public static void For<TSource, T1, T2, T3>(TSource repeats, Action<TSource, T1, T2, T3> method, T1 arg1, T2 arg2, T3 arg3)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | repeats | The amount of repeats to do. |
System.Action<TSource, T1, T2, T3> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2, T3>(Func<TSource, RelationalOperator, TSource, Boolean>, TSource, RelationalOperator, TSource, Func<TSource, AssignmentOperator, TSource, TSource>, AssignmentOperator, TSource, Action<TSource, T1, T2, T3>, T1, T2, T3)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void For<TSource, T1, T2, T3>(Func<TSource, RelationalOperator, TSource, bool> condition, TSource initial, RelationalOperator relational, TSource repeats, Func<TSource, AssignmentOperator, TSource, TSource> iterator, AssignmentOperator assignment, TSource step, Action<TSource, T1, T2, T3> method, T1 arg1, T2 arg2, T3 arg3)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
System.Func<TSource, RelationalOperator, TSource, System.Boolean> | condition | The condition delegate of the for-loop that is invoked once per iteration and determines the outcome of the conditional ruleset. |
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
System.Func<TSource, AssignmentOperator, TSource, TSource> | iterator | The iterator delegate of the for-loop that is invoked once per iteration and controls the steps of the |
AssignmentOperator | assignment | One of the enumeration values that specifies the rules to apply for the |
TSource | step | The value to assign the |
System.Action<TSource, T1, T2, T3> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2, T3, T4>(TSource, RelationalOperator, TSource, AssignmentOperator, TSource, Action<TSource, T1, T2, T3, T4>, T1, T2, T3, T4)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T).
Declaration
public static void For<TSource, T1, T2, T3, T4>(TSource initial, RelationalOperator relational, TSource repeats, AssignmentOperator assignment, TSource step, Action<TSource, T1, T2, T3, T4> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
AssignmentOperator | assignment | One of the enumeration values that specifies the rules to apply for the |
TSource | step | The value to assign the |
System.Action<TSource, T1, T2, T3, T4> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2, T3, T4>(TSource, RelationalOperator, TSource, Action<TSource, T1, T2, T3, T4>, T1, T2, T3, T4)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T), where the latter is initialized to increment counter
by 1 on each iteration.
Declaration
public static void For<TSource, T1, T2, T3, T4>(TSource initial, RelationalOperator relational, TSource repeats, Action<TSource, T1, T2, T3, T4> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
System.Action<TSource, T1, T2, T3, T4> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2, T3, T4>(TSource, Action<TSource, T1, T2, T3, T4>, T1, T2, T3, T4)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T), where the former is initialized to set counter
with an initial value of 0 and applying relational rule LessThan and the latter is initialized to increment counter
by 1 on each iteration.
Declaration
public static void For<TSource, T1, T2, T3, T4>(TSource repeats, Action<TSource, T1, T2, T3, T4> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | repeats | The amount of repeats to do. |
System.Action<TSource, T1, T2, T3, T4> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2, T3, T4>(Func<TSource, RelationalOperator, TSource, Boolean>, TSource, RelationalOperator, TSource, Func<TSource, AssignmentOperator, TSource, TSource>, AssignmentOperator, TSource, Action<TSource, T1, T2, T3, T4>, T1, T2, T3, T4)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void For<TSource, T1, T2, T3, T4>(Func<TSource, RelationalOperator, TSource, bool> condition, TSource initial, RelationalOperator relational, TSource repeats, Func<TSource, AssignmentOperator, TSource, TSource> iterator, AssignmentOperator assignment, TSource step, Action<TSource, T1, T2, T3, T4> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
System.Func<TSource, RelationalOperator, TSource, System.Boolean> | condition | The condition delegate of the for-loop that is invoked once per iteration and determines the outcome of the conditional ruleset. |
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
System.Func<TSource, AssignmentOperator, TSource, TSource> | iterator | The iterator delegate of the for-loop that is invoked once per iteration and controls the steps of the |
AssignmentOperator | assignment | One of the enumeration values that specifies the rules to apply for the |
TSource | step | The value to assign the |
System.Action<TSource, T1, T2, T3, T4> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2, T3, T4, T5>(TSource, RelationalOperator, TSource, AssignmentOperator, TSource, Action<TSource, T1, T2, T3, T4, T5>, T1, T2, T3, T4, T5)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T).
Declaration
public static void For<TSource, T1, T2, T3, T4, T5>(TSource initial, RelationalOperator relational, TSource repeats, AssignmentOperator assignment, TSource step, Action<TSource, T1, T2, T3, T4, T5> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
AssignmentOperator | assignment | One of the enumeration values that specifies the rules to apply for the |
TSource | step | The value to assign the |
System.Action<TSource, T1, T2, T3, T4, T5> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
T5 | arg5 | The fifth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
T5 | The type of the fifth parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2, T3, T4, T5>(TSource, RelationalOperator, TSource, Action<TSource, T1, T2, T3, T4, T5>, T1, T2, T3, T4, T5)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T), where the latter is initialized to increment counter
by 1 on each iteration.
Declaration
public static void For<TSource, T1, T2, T3, T4, T5>(TSource initial, RelationalOperator relational, TSource repeats, Action<TSource, T1, T2, T3, T4, T5> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
System.Action<TSource, T1, T2, T3, T4, T5> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
T5 | arg5 | The fifth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
T5 | The type of the fifth parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2, T3, T4, T5>(TSource, Action<TSource, T1, T2, T3, T4, T5>, T1, T2, T3, T4, T5)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
This overload uses the default implementation of the necessary two callback methods of the for-loop; Condition<T>(T, RelationalOperator, T) and Iterator<T>(T, AssignmentOperator, T), where the former is initialized to set counter
with an initial value of 0 and applying relational rule LessThan and the latter is initialized to increment counter
by 1 on each iteration.
Declaration
public static void For<TSource, T1, T2, T3, T4, T5>(TSource repeats, Action<TSource, T1, T2, T3, T4, T5> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
TSource | repeats | The amount of repeats to do. |
System.Action<TSource, T1, T2, T3, T4, T5> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
T5 | arg5 | The fifth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
T5 | The type of the fifth parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
For<TSource, T1, T2, T3, T4, T5>(Func<TSource, RelationalOperator, TSource, Boolean>, TSource, RelationalOperator, TSource, Func<TSource, AssignmentOperator, TSource, TSource>, AssignmentOperator, TSource, Action<TSource, T1, T2, T3, T4, T5>, T1, T2, T3, T4, T5)
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void For<TSource, T1, T2, T3, T4, T5>(Func<TSource, RelationalOperator, TSource, bool> condition, TSource initial, RelationalOperator relational, TSource repeats, Func<TSource, AssignmentOperator, TSource, TSource> iterator, AssignmentOperator assignment, TSource step, Action<TSource, T1, T2, T3, T4, T5> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
where TSource : struct, IComparable<TSource>, IEquatable<TSource>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
System.Func<TSource, RelationalOperator, TSource, System.Boolean> | condition | The condition delegate of the for-loop that is invoked once per iteration and determines the outcome of the conditional ruleset. |
TSource | initial | The initial value of the |
RelationalOperator | relational | One of the enumeration values that specifies the rules to apply for the |
TSource | repeats | The amount of repeats to do according to the rules specified by |
System.Func<TSource, AssignmentOperator, TSource, TSource> | iterator | The iterator delegate of the for-loop that is invoked once per iteration and controls the steps of the |
AssignmentOperator | assignment | One of the enumeration values that specifies the rules to apply for the |
TSource | step | The value to assign the |
System.Action<TSource, T1, T2, T3, T4, T5> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
T5 | arg5 | The fifth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
T5 | The type of the fifth parameter of the delegate |
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource
.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
ForEach<TSource>(IEnumerable<TSource>, Action<TSource>)
Provides a generic way of executing a foreach-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void ForEach<TSource>(IEnumerable<TSource> source, Action<TSource> method)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TSource> | source | The sequence that is iterated in the encapsulated foreach-loop. |
System.Action<TSource> | method | The delegate that is invoked once per iteration. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
ForEach<TSource, T>(IEnumerable<TSource>, Action<TSource, T>, T)
Provides a generic way of executing a foreach-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void ForEach<TSource, T>(IEnumerable<TSource> source, Action<TSource, T> method, T arg)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TSource> | source | The sequence that is iterated in the encapsulated foreach-loop. |
System.Action<TSource, T> | method | The delegate that is invoked once per iteration. |
T | arg | The parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T | The type of the parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
ForEach<TSource, T1, T2>(IEnumerable<TSource>, Action<TSource, T1, T2>, T1, T2)
Provides a generic way of executing a foreach-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void ForEach<TSource, T1, T2>(IEnumerable<TSource> source, Action<TSource, T1, T2> method, T1 arg1, T2 arg2)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TSource> | source | The sequence that is iterated in the encapsulated foreach-loop. |
System.Action<TSource, T1, T2> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
ForEach<TSource, T1, T2, T3>(IEnumerable<TSource>, Action<TSource, T1, T2, T3>, T1, T2, T3)
Provides a generic way of executing a foreach-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void ForEach<TSource, T1, T2, T3>(IEnumerable<TSource> source, Action<TSource, T1, T2, T3> method, T1 arg1, T2 arg2, T3 arg3)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TSource> | source | The sequence that is iterated in the encapsulated foreach-loop. |
System.Action<TSource, T1, T2, T3> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
ForEach<TSource, T1, T2, T3, T4>(IEnumerable<TSource>, Action<TSource, T1, T2, T3, T4>, T1, T2, T3, T4)
Provides a generic way of executing a foreach-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void ForEach<TSource, T1, T2, T3, T4>(IEnumerable<TSource> source, Action<TSource, T1, T2, T3, T4> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TSource> | source | The sequence that is iterated in the encapsulated foreach-loop. |
System.Action<TSource, T1, T2, T3, T4> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
ForEach<TSource, T1, T2, T3, T4, T5>(IEnumerable<TSource>, Action<TSource, T1, T2, T3, T4, T5>, T1, T2, T3, T4, T5)
Provides a generic way of executing a foreach-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void ForEach<TSource, T1, T2, T3, T4, T5>(IEnumerable<TSource> source, Action<TSource, T1, T2, T3, T4, T5> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TSource> | source | The sequence that is iterated in the encapsulated foreach-loop. |
System.Action<TSource, T1, T2, T3, T4, T5> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
T5 | arg5 | The fifth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
T5 | The type of the fifth parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
Iterator<T>(T, AssignmentOperator, T)
Provides a default implementation of a for-iterator callback method.
Declaration
public static T Iterator<T>(T current, AssignmentOperator assignment, T step)
where T : struct, IComparable<T>, IEquatable<T>, IConvertible
Parameters
Type | Name | Description |
---|---|---|
T | current | The current value of the counter in a for-loop. |
AssignmentOperator | assignment | One of the enumeration values that specifies the rules to apply as the assignment operator for left-hand operand |
T | step | The value to assign to |
Returns
Type | Description |
---|---|
T | The computed result of |
Type Parameters
Name | Description |
---|---|
T | The type of the counter in a for-loop. |
While<TSource>(TSource, Func<Boolean>, Action<TSource>)
Provides a generic way of executing a while-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void While<TSource>(TSource source, Func<bool> condition, Action<TSource> method)
where TSource : class
Parameters
Type | Name | Description |
---|---|---|
TSource | source | The object being iterated in the encapsulated while-loop by the |
System.Func<System.Boolean> | condition | The condition delegate of the while-loop that is invoked once per iteration and is a member of |
System.Action<TSource> | method | The delegate that is invoked once per iteration. |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
TypeArgumentException |
|
While<TSource, T>(TSource, Func<Boolean>, Action<TSource, T>, T)
Provides a generic way of executing a while-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void While<TSource, T>(TSource source, Func<bool> condition, Action<TSource, T> method, T arg)
where TSource : class
Parameters
Type | Name | Description |
---|---|---|
TSource | source | The object being iterated in the encapsulated while-loop by the |
System.Func<System.Boolean> | condition | The condition delegate of the while-loop that is invoked once per iteration and is a member of |
System.Action<TSource, T> | method | The delegate that is invoked once per iteration. |
T | arg | The parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T | The type of the parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
TypeArgumentException |
|
While<TSource, T1, T2>(TSource, Func<Boolean>, Action<TSource, T1, T2>, T1, T2)
Provides a generic way of executing a while-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void While<TSource, T1, T2>(TSource source, Func<bool> condition, Action<TSource, T1, T2> method, T1 arg1, T2 arg2)
where TSource : class
Parameters
Type | Name | Description |
---|---|---|
TSource | source | The object being iterated in the encapsulated while-loop by the |
System.Func<System.Boolean> | condition | The condition delegate of the while-loop that is invoked once per iteration and is a member of |
System.Action<TSource, T1, T2> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
TypeArgumentException |
|
While<TSource, T1, T2, T3>(TSource, Func<Boolean>, Action<TSource, T1, T2, T3>, T1, T2, T3)
Provides a generic way of executing a while-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void While<TSource, T1, T2, T3>(TSource source, Func<bool> condition, Action<TSource, T1, T2, T3> method, T1 arg1, T2 arg2, T3 arg3)
where TSource : class
Parameters
Type | Name | Description |
---|---|---|
TSource | source | The object being iterated in the encapsulated while-loop by the |
System.Func<System.Boolean> | condition | The condition delegate of the while-loop that is invoked once per iteration and is a member of |
System.Action<TSource, T1, T2, T3> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
TypeArgumentException |
|
While<TSource, T1, T2, T3, T4>(TSource, Func<Boolean>, Action<TSource, T1, T2, T3, T4>, T1, T2, T3, T4)
Provides a generic way of executing a while-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void While<TSource, T1, T2, T3, T4>(TSource source, Func<bool> condition, Action<TSource, T1, T2, T3, T4> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
where TSource : class
Parameters
Type | Name | Description |
---|---|---|
TSource | source | The object being iterated in the encapsulated while-loop by the |
System.Func<System.Boolean> | condition | The condition delegate of the while-loop that is invoked once per iteration and is a member of |
System.Action<TSource, T1, T2, T3, T4> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
TypeArgumentException |
|
While<TSource, T1, T2, T3, T4, T5>(TSource, Func<Boolean>, Action<TSource, T1, T2, T3, T4, T5>, T1, T2, T3, T4, T5)
Provides a generic way of executing a while-loop while providing ways to encapsulate and re-use existing code.
Declaration
public static void While<TSource, T1, T2, T3, T4, T5>(TSource source, Func<bool> condition, Action<TSource, T1, T2, T3, T4, T5> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
where TSource : class
Parameters
Type | Name | Description |
---|---|---|
TSource | source | The object being iterated in the encapsulated while-loop by the |
System.Func<System.Boolean> | condition | The condition delegate of the while-loop that is invoked once per iteration and is a member of |
System.Action<TSource, T1, T2, T3, T4, T5> | method | The delegate that is invoked once per iteration. |
T1 | arg1 | The first parameter of the delegate |
T2 | arg2 | The second parameter of the delegate |
T3 | arg3 | The third parameter of the delegate |
T4 | arg4 | The fourth parameter of the delegate |
T5 | arg5 | The fifth parameter of the delegate |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
T1 | The type of the first parameter of the delegate |
T2 | The type of the second parameter of the delegate |
T3 | The type of the third parameter of the delegate |
T4 | The type of the fourth parameter of the delegate |
T5 | The type of the fifth parameter of the delegate |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
TypeArgumentException |
|