Click or drag to resize

RangeTIterate Method

Iterates the range between the start and end values.

Namespace:  Eto.Forms
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
public IEnumerable<T> Iterate(
	Func<T, T> increment


Type: SystemFuncT, T
Delegate to increment the value for each iteration of the enumerable.

Return Value

Type: IEnumerableT

[Missing <returns> documentation for "M:Eto.Forms.Range`1.Iterate(System.Func{`0,`0})"]

This can be used to return an enumerable that iterates between the start and end of the range given the specified increment function.
// iterate over an int range
var intRange = new Range<int>(1, 200);
foreach (var item in intRange.Iterate(i => i + 1))
    // logic

// iterate over a date range by minute
var dateRange = new Range<DateTime>(DateTime.Today, DateTime.Today.AddDays(2));
foreach (var item in dateRange.Iterate(i => i.AddMinutes(1)))
    // logic
See Also