Show / Hide Table of Contents

    Class LoopUtility

    Provides support for a generic way of specifying loops while providing ways to encapsulate and re-use existing code.

    Inheritance
    System.Object
    LoopUtility
    Namespace: Cuemon
    Assembly: Cuemon.Core.dll
    Syntax
    public static class LoopUtility

    Methods

    | Improve this Doc

    Condition<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 current and right-hand operand repeats.

    T repeats

    The amount of repeats to do according to the rules specified by relational.

    Returns
    Type Description
    System.Boolean

    true if current does not meet the condition of relational and repeats; otherwise false.

    Type Parameters
    Name Description
    T

    The type of the counter in a for-loop.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    AssignmentOperator assignment

    One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.

    TSource step

    The value to assign the counter according to the rule specified by assignment.

    System.Action<TSource> method

    The delegate that is invoked once per iteration.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    System.Action<TSource> method

    The delegate that is invoked once per iteration.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the encapsulated for-loop.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    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 counter.

    AssignmentOperator assignment

    One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.

    TSource step

    The value to assign the counter according to the rule specified by assignment.

    System.Action<TSource> method

    The delegate that is invoked once per iteration.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    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

    condition is null - or - iterator is null - or - method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    AssignmentOperator assignment

    One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.

    TSource step

    The value to assign the counter according to the rule specified by assignment.

    System.Action<TSource, T> method

    The delegate that is invoked once per iteration.

    T arg

    The first parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T

    The type of the parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    System.Action<TSource, T> method

    The delegate that is invoked once per iteration.

    T arg

    The parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T

    The type of the parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T

    The type of the parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    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 counter.

    AssignmentOperator assignment

    One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.

    TSource step

    The value to assign the counter according to the rule specified by assignment.

    System.Action<TSource, T> method

    The delegate that is invoked once per iteration.

    T arg

    The parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T

    The type of the parameter of the delegate method.

    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

    condition is null - or - iterator is null - or - method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    AssignmentOperator assignment

    One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.

    TSource step

    The value to assign the counter according to the rule specified by assignment.

    System.Action<TSource, T1, T2> method

    The delegate that is invoked once per iteration.

    T1 arg1

    The first parameter of the delegate method.

    T2 arg2

    The second parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    System.Action<TSource, T1, T2> method

    The delegate that is invoked once per iteration.

    T1 arg1

    The first parameter of the delegate method.

    T2 arg2

    The second parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 method.

    T2 arg2

    The second parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    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 counter.

    AssignmentOperator assignment

    One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.

    TSource step

    The value to assign the counter according to the rule specified by assignment.

    System.Action<TSource, T1, T2> method

    The delegate that is invoked once per iteration.

    T1 arg1

    The first parameter of the delegate method.

    T2 arg2

    The second parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    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

    condition is null - or - iterator is null - or - method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    AssignmentOperator assignment

    One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.

    TSource step

    The value to assign the counter according to the rule specified by assignment.

    System.Action<TSource, T1, T2, T3> method

    The delegate that is invoked once per iteration.

    T1 arg1

    The first parameter of the delegate method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    System.Action<TSource, T1, T2, T3> method

    The delegate that is invoked once per iteration.

    T1 arg1

    The first parameter of the delegate method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    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 counter.

    AssignmentOperator assignment

    One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.

    TSource step

    The value to assign the counter according to the rule specified by assignment.

    System.Action<TSource, T1, T2, T3> method

    The delegate that is invoked once per iteration.

    T1 arg1

    The first parameter of the delegate method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    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

    condition is null - or - iterator is null - or - method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    AssignmentOperator assignment

    One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.

    TSource step

    The value to assign the counter according to the rule specified by assignment.

    System.Action<TSource, T1, T2, T3, T4> method

    The delegate that is invoked once per iteration.

    T1 arg1

    The first parameter of the delegate method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    T4 arg4

    The fourth parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    T4

    The type of the fourth parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    System.Action<TSource, T1, T2, T3, T4> method

    The delegate that is invoked once per iteration.

    T1 arg1

    The first parameter of the delegate method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    T4 arg4

    The fourth parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    T4

    The type of the fourth parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    T4 arg4

    The fourth parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    T4

    The type of the fourth parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    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 counter.

    AssignmentOperator assignment

    One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.

    TSource step

    The value to assign the counter according to the rule specified by assignment.

    System.Action<TSource, T1, T2, T3, T4> method

    The delegate that is invoked once per iteration.

    T1 arg1

    The first parameter of the delegate method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    T4 arg4

    The fourth parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    T4

    The type of the fourth parameter of the delegate method.

    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

    condition is null - or - iterator is null - or - method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    AssignmentOperator assignment

    One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.

    TSource step

    The value to assign the counter according to the rule specified by assignment.

    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 method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    T4 arg4

    The fourth parameter of the delegate method.

    T5 arg5

    The fifth parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    T4

    The type of the fourth parameter of the delegate method.

    T5

    The type of the fifth parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    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 method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    T4 arg4

    The fourth parameter of the delegate method.

    T5 arg5

    The fifth parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    T4

    The type of the fourth parameter of the delegate method.

    T5

    The type of the fifth parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    T4 arg4

    The fourth parameter of the delegate method.

    T5 arg5

    The fifth parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    T4

    The type of the fourth parameter of the delegate method.

    T5

    The type of the fifth parameter of the delegate method.

    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

    method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 counter in the for-loop.

    RelationalOperator relational

    One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.

    TSource repeats

    The amount of repeats to do according to the rules specified by relational.

    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 counter.

    AssignmentOperator assignment

    One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.

    TSource step

    The value to assign the counter according to the rule specified by assignment.

    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 method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    T4 arg4

    The fourth parameter of the delegate method.

    T5 arg5

    The fifth parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the counter in the encapsulated for-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    T4

    The type of the fourth parameter of the delegate method.

    T5

    The type of the fifth parameter of the delegate method.

    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

    condition is null - or - iterator is null - or - method is null.

    System.ArgumentOutOfRangeException

    TSource is outside the range of allowed types.
    Allowed types are: System.Byte, System.Decimal, System.Double, System.Int16, System.Int32, System.Int64, System.SByte, System.Single, System.UInt16, System.UInt32 or System.UInt64.

    | Improve this Doc

    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 source in the encapsulated foreach-loop.

    Exceptions
    Type Condition
    System.ArgumentNullException

    method is null -or- source is null.

    | Improve this Doc

    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 method.

    Type Parameters
    Name Description
    TSource

    The type of the source in the encapsulated foreach-loop.

    T

    The type of the parameter of the delegate method.

    Exceptions
    Type Condition
    System.ArgumentNullException

    method is null -or- source is null.

    | Improve this Doc

    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 method.

    T2 arg2

    The second parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the source in the encapsulated foreach-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    Exceptions
    Type Condition
    System.ArgumentNullException

    method is null -or- source is null.

    | Improve this Doc

    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 method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the source in the encapsulated foreach-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    Exceptions
    Type Condition
    System.ArgumentNullException

    method is null -or- source is null.

    | Improve this Doc

    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 method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    T4 arg4

    The fourth parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the source in the encapsulated foreach-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    T4

    The type of the fourth parameter of the delegate method.

    Exceptions
    Type Condition
    System.ArgumentNullException

    method is null -or- source is null.

    | Improve this Doc

    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 method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    T4 arg4

    The fourth parameter of the delegate method.

    T5 arg5

    The fifth parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the source in the encapsulated foreach-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    T4

    The type of the fourth parameter of the delegate method.

    T5

    The type of the fifth parameter of the delegate method.

    Exceptions
    Type Condition
    System.ArgumentNullException

    method is null -or- source is null.

    | Improve this Doc

    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 current and right-hand operand step.

    T step

    The value to assign to current according to the rule specified by assignment.

    Returns
    Type Description
    T

    The computed result of current having the assignment of step.

    Type Parameters
    Name Description
    T

    The type of the counter in a for-loop.

    | Improve this Doc

    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 condition delegate.

    System.Func<System.Boolean> condition

    The condition delegate of the while-loop that is invoked once per iteration and is a member of source.

    System.Action<TSource> method

    The delegate that is invoked once per iteration.

    Type Parameters
    Name Description
    TSource

    The type of the source in the encapsulated while-loop.

    Exceptions
    Type Condition
    System.ArgumentNullException

    condition is null -or- method is null. condition delegate does not target an instance method on source

    TypeArgumentException

    source does not match the source of the condition delegate target.

    | Improve this Doc

    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 condition delegate.

    System.Func<System.Boolean> condition

    The condition delegate of the while-loop that is invoked once per iteration and is a member of source.

    System.Action<TSource, T> method

    The delegate that is invoked once per iteration.

    T arg

    The parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the source in the encapsulated while-loop.

    T

    The type of the parameter of the delegate method.

    Exceptions
    Type Condition
    System.ArgumentNullException

    condition is null -or- method is null. condition delegate does not target an instance method on source

    TypeArgumentException

    source does not match the source of the condition delegate target.

    | Improve this Doc

    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 condition delegate.

    System.Func<System.Boolean> condition

    The condition delegate of the while-loop that is invoked once per iteration and is a member of source.

    System.Action<TSource, T1, T2> method

    The delegate that is invoked once per iteration.

    T1 arg1

    The first parameter of the delegate method.

    T2 arg2

    The second parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the source in the encapsulated while-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    Exceptions
    Type Condition
    System.ArgumentNullException

    condition is null -or- method is null. condition delegate does not target an instance method on source

    TypeArgumentException

    source does not match the source of the condition delegate target.

    | Improve this Doc

    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 condition delegate.

    System.Func<System.Boolean> condition

    The condition delegate of the while-loop that is invoked once per iteration and is a member of source.

    System.Action<TSource, T1, T2, T3> method

    The delegate that is invoked once per iteration.

    T1 arg1

    The first parameter of the delegate method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the source in the encapsulated while-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    Exceptions
    Type Condition
    System.ArgumentNullException

    condition is null -or- method is null. condition delegate does not target an instance method on source

    TypeArgumentException

    source does not match the source of the condition delegate target.

    | Improve this Doc

    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 condition delegate.

    System.Func<System.Boolean> condition

    The condition delegate of the while-loop that is invoked once per iteration and is a member of source.

    System.Action<TSource, T1, T2, T3, T4> method

    The delegate that is invoked once per iteration.

    T1 arg1

    The first parameter of the delegate method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    T4 arg4

    The fourth parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the source in the encapsulated while-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    T4

    The type of the fourth parameter of the delegate method.

    Exceptions
    Type Condition
    System.ArgumentNullException

    condition is null -or- method is null. condition delegate does not target an instance method on source

    TypeArgumentException

    source does not match the source of the condition delegate target.

    | Improve this Doc

    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 condition delegate.

    System.Func<System.Boolean> condition

    The condition delegate of the while-loop that is invoked once per iteration and is a member of source.

    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 method.

    T2 arg2

    The second parameter of the delegate method.

    T3 arg3

    The third parameter of the delegate method.

    T4 arg4

    The fourth parameter of the delegate method.

    T5 arg5

    The fifth parameter of the delegate method.

    Type Parameters
    Name Description
    TSource

    The type of the source in the encapsulated while-loop.

    T1

    The type of the first parameter of the delegate method.

    T2

    The type of the second parameter of the delegate method.

    T3

    The type of the third parameter of the delegate method.

    T4

    The type of the fourth parameter of the delegate method.

    T5

    The type of the fifth parameter of the delegate method.

    Exceptions
    Type Condition
    System.ArgumentNullException

    condition is null -or- method is null. condition delegate does not target an instance method on source

    TypeArgumentException

    source does not match the source of the condition delegate target.

    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX