Class IEnumeratorExtensions
- Namespace
- Garyon.Extensions
- Assembly
- Garyon.dll
Contains extension methods for the IEnumerator<T> interface.
public static class IEnumeratorExtensions
- Inheritance
-
IEnumeratorExtensions
- Inherited Members
Methods
GetEnumerator(IEnumerator)
Returns the given enumerator instance.
public static IEnumerator GetEnumerator(this IEnumerator enumerator)
Parameters
enumeratorIEnumeratorThe enumerator instance to return.
Returns
- IEnumerator
The given enumerator instance.
Remarks
This method is only present to enable direct enumeration of the
enumeartor in a foreach statement.
Avoid using it directly.
GetEnumerator<T>(IEnumerator<T>)
Returns the given enumerator instance.
public static IEnumerator<T> GetEnumerator<T>(this IEnumerator<T> enumerator)
Parameters
enumeratorIEnumerator<T>The enumerator instance to return.
Returns
- IEnumerator<T>
The given enumerator instance.
Type Parameters
TThe type of the enumerated values.
Remarks
This method is only present to enable direct enumeration of the
enumeartor in a foreach statement.
Avoid using it directly.
GetEnumerator<TEnumerator>(TEnumerator)
Returns the given enumerator instance.
public static TEnumerator GetEnumerator<TEnumerator>(this TEnumerator enumerator) where TEnumerator : IEnumerator
Parameters
enumeratorTEnumeratorThe enumerator instance to return.
Returns
- TEnumerator
The given enumerator instance.
Type Parameters
TEnumerator
Remarks
This method is only present to enable direct enumeration of the
enumeartor in a foreach statement.
Avoid using it directly.
GetEnumerator<TEnumerator, TValue>(TEnumerator)
Returns the given enumerator instance.
public static TEnumerator GetEnumerator<TEnumerator, TValue>(this TEnumerator enumerator) where TEnumerator : IEnumerator<TValue>
Parameters
enumeratorTEnumeratorThe enumerator instance to return.
Returns
- TEnumerator
The given enumerator instance.
Type Parameters
TEnumeratorThe type of the enumerator.
TValueThe type of the enumerated values.
Remarks
This method is only present to enable direct enumeration of the
enumeartor in a foreach statement.
Avoid using it directly.
ToArray<T>(IEnumerator<T>, bool)
public static T[] ToArray<T>(this IEnumerator<T> enumerator, bool resetEnumerator = false)
Parameters
enumeratorIEnumerator<T>resetEnumeratorbool
Returns
- T[]
Type Parameters
T
ToImmutableArray<T>(IEnumerator<T>, bool)
public static ImmutableArray<T> ToImmutableArray<T>(this IEnumerator<T> enumerator, bool resetEnumerator = false)
Parameters
enumeratorIEnumerator<T>resetEnumeratorbool
Returns
Type Parameters
T
ToList<T>(IEnumerator<T>, bool)
public static List<T> ToList<T>(this IEnumerator<T> enumerator, bool resetEnumerator = false)
Parameters
enumeratorIEnumerator<T>resetEnumeratorbool
Returns
- List<T>
Type Parameters
T
WithResetState<T>(IEnumerator<T>)
public static IEnumerator<T> WithResetState<T>(this IEnumerator<T> enumerator)
Parameters
enumeratorIEnumerator<T>
Returns
- IEnumerator<T>
Type Parameters
T