Cuemon .NET Framework
For<TSource>(TSource,Act<TSource>) Method

The type of the counter in the encapsulated for-loop.
The amount of repeats to do.
The delegate that is invoked once per iteration.
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> and Iterator<T>, where the former is initialized to set counter with an initial value of 0 and applying relational rule RelationalOperator.LessThan and the latter is initialized to increment counter by 1 on each iteration.
Public Overloads Shared Sub For(Of TSource As {New, IComparable(Of TSource), IEquatable(Of TSource), IConvertible, Struct})( _
   ByVal repeats As TSource, _
   ByVal method As Cuemon.Act(Of TSource) _
public static void For<TSource>( 
   TSource repeats,
   Cuemon.Act<TSource> method
where TSource: new(), IComparable<TSource>, IEquatable<TSource>, IConvertible, struct


The amount of repeats to do.
The delegate that is invoked once per iteration.

Type Parameters

The type of the counter in the encapsulated for-loop.
System.ArgumentNullExceptionmethod 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.
Do not use this method for time critical operations as there are quite some overhead do to validation of generic parameter TSource.

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


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