Show / Hide Table of Contents

    Class ListUtility

    This utility class is designed to make System.Collections.Generic.IList<T> related conversions easier to work with.

    Inheritance
    System.Object
    ListUtility
    Namespace: Cuemon.Collections.Generic
    Assembly: Cuemon.Core.dll
    Syntax
    public static class ListUtility

    Methods

    | Improve this Doc

    HasIndex<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

    true if the specified index is within the range of the elements; otherwise, false.

    Type Parameters
    Name Description
    TSource

    The type of elements in the System.Collections.Generic.IList<T>.

    Exceptions
    Type Condition
    System.ArgumentNullException

    elements is null.

    | Improve this Doc

    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 index, to return the next element of.

    Returns
    Type Description
    TSource

    default(TSource) if index is equal or greater than System.Collections.Generic.ICollection<T>.Count; otherwise the next element of elements relative to index.

    Type Parameters
    Name Description
    TSource

    The type of elements in the System.Collections.Generic.IList<T>.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    index is less than 0.

    | Improve this Doc

    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 index, to return the previous element of.

    Returns
    Type Description
    TSource

    default(TSource) if index is equal, greater or lower than System.Collections.Generic.ICollection<T>.Count; otherwise the previous element of elements relative to index.

    Type Parameters
    Name Description
    TSource

    The type of elements in the System.Collections.Generic.IList<T>.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    index is less than 0.

    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX