Class ListUtility
This utility class is designed to make System.Collections.Generic.IList<T> related conversions easier to work with.
Inheritance
Namespace: Cuemon.Collections.Generic
Assembly: Cuemon.Core.dll
Syntax
public static class ListUtility
Methods
| Improve this DocHasIndex<TSource>(Int32, IList<TSource>)
Determines whether the elements
of the System.Collections.Generic.IList<T> is within the range of the index
.
Declaration
public static bool HasIndex<TSource>(int index, IList<TSource> elements)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to find. |
System.Collections.Generic.IList<TSource> | elements | The elements of the System.Collections.Generic.IList<T>. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
TSource | The type of elements in the System.Collections.Generic.IList<T>. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
Next<TSource>(Int32, IList<TSource>)
Returns the next element of elements
relative to index
, or the last element of elements
if index
is equal or greater than System.Collections.Generic.ICollection<T>.Count.
Declaration
public static TSource Next<TSource>(int index, IList<TSource> elements)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of which to advance to the next element from. |
System.Collections.Generic.IList<TSource> | elements | The elements, relative to |
Returns
Type | Description |
---|---|
TSource | default(TSource) if |
Type Parameters
Name | Description |
---|---|
TSource | The type of elements in the System.Collections.Generic.IList<T>. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException |
|
Previous<TSource>(Int32, IList<TSource>)
Returns the previous element of elements
relative to index
, or the first or last element of elements
if index
is equal, greater or lower than System.Collections.Generic.ICollection<T>.Count.
Declaration
public static TSource Previous<TSource>(int index, IList<TSource> elements)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of which to advance to the previous element from. |
System.Collections.Generic.IList<TSource> | elements | The elements, relative to |
Returns
Type | Description |
---|---|
TSource | default(TSource) if |
Type Parameters
Name | Description |
---|---|
TSource | The type of elements in the System.Collections.Generic.IList<T>. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException |
|