Cuemon .NET Framework
For<TSource,T1,T2,T3,T4>(Doer<TSource,RelationalOperator,TSource,Boolean>,TSource,RelationalOperator,TSource,Doer<TSource,AssignmentOperator,TSource,TSource>,AssignmentOperator,TSource,Act<TSource,T1,T2,T3,T4>,T1,T2,T3,T4) Method

The type of the counter in the encapsulated for-loop.
The type of the first parameter of the delegate method.
The type of the second parameter of the delegate method.
The type of the third parameter of the delegate method.
The type of the fourth parameter of the delegate method.
The condition delegate of the for-loop that is invoked once per iteration and determines the outcome of the conditional ruleset.
The initial value of the counter in the for-loop.
One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.
The amount of repeats to do according to the rules specified by relational.
The iterator delegate of the for-loop that is invoked once per iteration and controls the steps of the counter.
One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.
The value to assign the counter according to the rule specified by assignment.
The delegate that is invoked once per iteration.
The first parameter of the delegate method.
The second parameter of the delegate method.
The third parameter of the delegate method.
The fourth parameter of the delegate method.
Provides a generic way of executing a for-loop while providing ways to encapsulate and re-use existing code.
Syntax
'Declaration
 
Public Overloads Shared Sub For
    (Of TSource As {New, IComparable(Of TSource), IEquatable(Of TSource), IConvertible, Struct},
     T1,T2,T3,T4)( _
   ByVal condition As Cuemon.Doer(Of TSource,RelationalOperator,TSource,Boolean), _
   ByVal initial As TSource, _
   ByVal relational As RelationalOperator, _
   ByVal repeats As TSource, _
   ByVal iterator As Cuemon.Doer(Of TSource,AssignmentOperator,TSource,TSource), _
   ByVal assignment As AssignmentOperator, _
   ByVal step As TSource, _
   ByVal method As Cuemon.Act(Of TSource,T1,T2,T3,T4), _
   ByVal arg1 As T1, _
   ByVal arg2 As T2, _
   ByVal arg3 As T3, _
   ByVal arg4 As T4 _
) 
public static void For<TSource,T1,T2,T3,T4>( 
   Cuemon.Doer<TSource,RelationalOperator,TSource,bool> condition,
   TSource initial,
   RelationalOperator relational,
   TSource repeats,
   Cuemon.Doer<TSource,AssignmentOperator,TSource,TSource> iterator,
   AssignmentOperator assignment,
   TSource step,
   Cuemon.Act<TSource,T1,T2,T3,T4> method,
   T1 arg1,
   T2 arg2,
   T3 arg3,
   T4 arg4
)
where TSource: new(), IComparable<TSource>, IEquatable<TSource>, IConvertible, struct

Parameters

condition
The condition delegate of the for-loop that is invoked once per iteration and determines the outcome of the conditional ruleset.
initial
The initial value of the counter in the for-loop.
relational
One of the enumeration values that specifies the rules to apply for the condition relational operator of the for-loop.
repeats
The amount of repeats to do according to the rules specified by relational.
iterator
The iterator delegate of the for-loop that is invoked once per iteration and controls the steps of the counter.
assignment
One of the enumeration values that specifies the rules to apply for the iterator assignment operator of the for-loop.
step
The value to assign the counter according to the rule specified by assignment.
method
The delegate that is invoked once per iteration.
arg1
The first parameter of the delegate method.
arg2
The second parameter of the delegate method.
arg3
The third parameter of the delegate method.
arg4
The fourth parameter of the delegate method.

Type Parameters

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.
Exceptions
ExceptionDescription
System.ArgumentNullExceptioncondition is null - or - iterator is null - or - method is null.
System.ArgumentOutOfRangeExceptionTSource 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.
Remarks
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource.
Requirements

Target Platforms: Windows 8, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

LoopUtility Class
LoopUtility Members
Overload List

 

 


| Cuemon is licensed under a The MIT License (MIT)



© 2009-2015 Weubphoria. All Rights Reserved.

Documentation made easy with Document! X by Innovasys

Send Feedback