Search Results for

    Show / Hide Table of Contents

    Class IntegerEnumerableExtensions

    Extensions for integer enumerables

    Inheritance
    System.Object
    IntegerEnumerableExtensions
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: ImageVault.Common.Lib
    Assembly: ImageVault.Common.dll
    Syntax
    public static class IntegerEnumerableExtensions

    Methods

    SelectLesserOrEqualItem(IEnumerable<Int32>, Int32)

    Returns the first item in the supplied list that is lesser or equal to the supplied value. If no value is lesser or equal, the last item in the list is returned.

    Declaration
    public static int SelectLesserOrEqualItem(this IEnumerable<int> list, int val)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Int32> list

    The list of integers to look through. Must be sorted in descending order

    System.Int32 val

    The value to compare with

    Returns
    Type Description
    System.Int32

    The first value from the list that is

    1. less or equal to the supplied value
    2. or the last value if none of the values matches the first rule

    Exceptions
    Type Condition
    System.ArgumentNullException

    If list is null

    System.ArgumentException

    If list contains no items

    In This Article
    Back to top (c) Meriworks 2002-2022