Class ForLoopRuleset<TOperand>
- Namespace
- Cuemon.Threading
- Assembly
- Cuemon.Threading.dll
Specifies the rules of a for-loop control flow statement.
public class ForLoopRuleset<TOperand>
where TOperand : struct, IComparable<TOperand>, IEquatable<TOperand>, IConvertible
Type Parameters
TOperand
The type of the number used with the loop control variable.
- Inheritance
-
ForLoopRuleset<TOperand>
Constructors
ForLoopRuleset()
Initializes a new instance of the ForLoopRuleset<TOperand> class.
public ForLoopRuleset()
Exceptions
- TypeArgumentOutOfRangeException
TOperand
is outside the range of allowed types.
Allowed types are: Byte, Decimal, Double, Int16, Int32, Int64, SByte, Single, UInt16, UInt32 or UInt64.
ForLoopRuleset(TOperand, TOperand, TOperand, RelationalOperator, AssignmentOperator, Func<TOperand, RelationalOperator, TOperand, Boolean>, Func<TOperand, AssignmentOperator, TOperand, TOperand>)
Initializes a new instance of the ForLoopRuleset<TOperand> class.
public ForLoopRuleset(TOperand from, TOperand to, TOperand step, RelationalOperator relation = RelationalOperator.LessThan, AssignmentOperator assignment = AssignmentOperator.Addition, Func<TOperand, RelationalOperator, TOperand, bool> condition = null, Func<TOperand, AssignmentOperator, TOperand, TOperand> iterator = null)
Parameters
from
TOperandThe rules of a for-loop control flow statement.
to
TOperandThe conditional value of the loop control variable.
step
TOperandThe value to assign the loop control variable.
relation
RelationalOperatorThe relation between the loop control variable
from
andto
.assignment
AssignmentOperatorThe assignment statement of the loop control variable using
step
.condition
Func<TOperand, RelationalOperator, TOperand, Boolean>The function delegate that represents the condition section of the for loop. Default value is Condition<T>(T, RelationalOperator, T).
iterator
Func<TOperand, AssignmentOperator, TOperand, TOperand>The function delegate that represents the iterator section of the for loop. Default value is Iterator<T>(T, AssignmentOperator, T).
Exceptions
- TypeArgumentOutOfRangeException
TOperand
is outside the range of allowed types.
Allowed types are: Byte, Decimal, Double, Int16, Int32, Int64, SByte, Single, UInt16, UInt32 or UInt64.
Properties
Assignment
Gets or sets the assignment statement of the loop control variable using Step.
public AssignmentOperator Assignment { get; set; }
Property Value
- AssignmentOperator
The assignment statement of the loop control variable.
Condition
Gets or sets the function delegate of a for-condition.
public Func<TOperand, RelationalOperator, TOperand, bool> Condition { get; set; }
Property Value
- Func<TOperand, RelationalOperator, TOperand, Boolean>
The function delegate of a for-condition.
From
Gets or sets the initial value of the loop control variable.
public TOperand From { get; set; }
Property Value
- TOperand
The initial value of the loop control variable.
Iterator
Gets or sets the function delegate of a for-iterator.
public Func<TOperand, AssignmentOperator, TOperand, TOperand> Iterator { get; set; }
Property Value
- Func<TOperand, AssignmentOperator, TOperand, TOperand>
The function delegate of a for-iterator.
Relation
public RelationalOperator Relation { get; set; }
Property Value
- RelationalOperator
The relation between the loop control variable.
Step
Gets or sets the number to assign the loop control variable.
public TOperand Step { get; set; }
Property Value
- TOperand
The number to assign the loop control variable.
To
Gets or sets the conditional value of the loop control variable.
public TOperand To { get; set; }
Property Value
- TOperand
The conditional value of the loop control variable.