Show / Hide Table of Contents

    Struct Range<T>

    Represents a range between minimum and maximum values.

    Представляет диапазон между минимальным и максимальным значениями.

    Implements
    IEquatable<Range<T>>
    Namespace: Platform.Ranges
    Assembly: Platform.Ranges.dll
    Syntax
    public struct Range<T> : IEquatable<Range<T>>
    Type Parameters
    Name Description
    T
    Remarks

    Based on the question at StackOverflow.

    Основано на вопросе в StackOverflow.

    Constructors

    | Improve this Doc View Source

    Range(T)

    Initializes a new instance of the Range class.

    Инициализирует новый экземпляр класса Range.

    Declaration
    public Range(T minimumAndMaximum)
    Parameters
    Type Name Description
    T minimumAndMaximum

    Single value for both Minimum and Maximum fields.

    Одно значение для полей Minimum и Maximum.

    | Improve this Doc View Source

    Range(T, T)

    Initializes a new instance of the Range class.

    Инициализирует новый экземпляр класса Range.

    Declaration
    public Range(T minimum, T maximum)
    Parameters
    Type Name Description
    T minimum

    The minimum value of the range.

    Минимальное значение диапазона.

    T maximum

    The maximum value of the range.

    Максимальное значение диапазона.

    Fields

    | Improve this Doc View Source

    Maximum

    Returns maximum value of the range.

    Возвращает максимальное значение диапазона.

    Declaration
    public readonly T Maximum
    Field Value
    Type Description
    T
    | Improve this Doc View Source

    Minimum

    Returns minimum value of the range.

    Возвращает минимальное значение диапазона.

    Declaration
    public readonly T Minimum
    Field Value
    Type Description
    T

    Methods

    | Improve this Doc View Source

    Contains(T)

    Determines if the provided value is inside the range.

    Определяет, находится ли указанное значение внутри диапазона.

    Declaration
    public bool Contains(T value)
    Parameters
    Type Name Description
    T value

    The value to test.

    Значение для проверки.

    Returns
    Type Description
    Boolean

    True if the value is inside Range, else false.

    True, если значение находится внутри диапазона, иначе false.

    | Improve this Doc View Source

    Contains(Range<T>)

    Determines if another range is inside the bounds of this range.

    Определяет, находится ли другой диапазон внутри границ этого диапазона.

    Declaration
    public bool Contains(Range<T> range)
    Parameters
    Type Name Description
    Range<T> range

    The child range to test.

    Дочерний диапазон для проверки.

    Returns
    Type Description
    Boolean

    True if range is inside, else false.

    True, если диапазон находится внутри, иначе false.

    | Improve this Doc View Source

    Equals(Range<T>)

    Determines whether the current range is equal to another range.

    Определяет, равен ли текущий диапазон другому диапазону.

    Declaration
    public bool Equals(Range<T> other)
    Parameters
    Type Name Description
    Range<T> other

    A range to compare with this range.

    Диапазон для сравнения с этим диапазоном.

    Returns
    Type Description
    Boolean

    True if the current range is equal to the other range; otherwise, false.

    True, если текущий диапазон равен другому диапазону; иначе false.

    | Improve this Doc View Source

    Equals(Object)

    Determines whether the current range is equal to another object.

    Определяет, равен ли текущий диапазон другому объекту.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    An object to compare with this range.

    Объект для сравнения с этим диапазоном.

    Returns
    Type Description
    Boolean

    True if the current range is equal to the other object; otherwise, false.

    True, если текущий диапазон равен другому объекту; иначе false.

    | Improve this Doc View Source

    GetHashCode()

    Calculates the hash code for the current Range<T> instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    The hash code for the current Range<T> instance.

    | Improve this Doc View Source

    ToString()

    Presents the Range in readable format.

    Представляет диапазон в удобном для чтения формате.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    String representation of the Range.

    Строковое представление диапазона.

    Operators

    | Improve this Doc View Source

    Equality(Range<T>, Range<T>)

    Determines if the specified range is equal to the current range.

    Определяет, равен ли указанный диапазон текущему диапазону.

    Declaration
    public static bool operator ==(Range<T> left, Range<T> right)
    Parameters
    Type Name Description
    Range<T> left

    The current range.

    Текущий диапазон.

    Range<T> right

    A range to compare with this range.

    Диапазон для сравнения с этим диапазоном.

    Returns
    Type Description
    Boolean

    True if the current range is equal to the other range; otherwise, false.

    True, если текущий диапазон равен другому диапазону; иначе false.

    | Improve this Doc View Source

    Implicit(Range<T> to ValueTuple<T, T>)

    Creates a new struct initialized with Minimum as and Maximum as .

    Создает новую структуру , инициализированную с помощью Minimum как и Maximum как .

    Declaration
    public static implicit operator ValueTuple<T, T>(Range<T> range)
    Parameters
    Type Name Description
    Range<T> range

    The range of T.

    Диапазон значений T.

    Returns
    Type Description
    ValueTuple<T, T>
    | Improve this Doc View Source

    Implicit(ValueTuple<T, T> to Range<T>)

    Creates a new Range<T> struct initialized with as Minimum and as Maximum.

    Создает новую структуру Range<T>, инициализированную с помощью как Minimum и как Maximum.

    Declaration
    public static implicit operator Range<T>(ValueTuple<T, T> tuple)
    Parameters
    Type Name Description
    ValueTuple<T, T> tuple

    The tuple.

    Кортеж.

    Returns
    Type Description
    Range<T>
    | Improve this Doc View Source

    Inequality(Range<T>, Range<T>)

    Determines if the specified range is not equal to the current range.

    Определяет, не равен ли указанный диапазон текущему диапазону.

    Declaration
    public static bool operator !=(Range<T> left, Range<T> right)
    Parameters
    Type Name Description
    Range<T> left

    The current range.

    Текущий диапазон.

    Range<T> right

    A range to compare with this range.

    Диапазон для сравнения с этим диапазоном.

    Returns
    Type Description
    Boolean

    True if the current range is not equal to the other range; otherwise, false.

    True, если текущий диапазон не равен другому диапазону; иначе false.

    Implements

    IEquatable<>
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX