• Docs
  • Learn
  • Community
    Search Results for

      Show / Hide Table of Contents

      Class Range<TValue>

      Represents a range of values defined by an inclusive lower and upper bounds.

      Inheritance
      Object
      Range<TValue>
      Implements
      IEquatable<Range<TValue>>
      Inherited Members
      Object.Equals(Object, Object)
      Object.ReferenceEquals(Object, Object)
      Object.GetType()
      Object.MemberwiseClone()
      Namespace: Bonsai
      Assembly: Bonsai.Core.dll
      Syntax
      public sealed class Range<TValue> : IEquatable<Range<TValue>>
      Type Parameters
      Name Description
      TValue

      The type of values in the range.

      Constructors

      | Improve this Doc View Source

      Range(TValue, TValue)

      Initializes a new instance of the Range<TValue> class with the specified lower and upper bounds.

      Declaration
      public Range(TValue lowerBound, TValue upperBound)
      Parameters
      Type Name Description
      TValue lowerBound

      The inclusive lower bound of the range.

      TValue upperBound

      The inclusive upper bound of the range.

      | Improve this Doc View Source

      Range(TValue, TValue, IComparer<TValue>)

      Initializes a new instance of the Range<TValue> class with the specified lower and upper bounds and using the specified comparer.

      Declaration
      public Range(TValue lowerBound, TValue upperBound, IComparer<TValue> comparer)
      Parameters
      Type Name Description
      TValue lowerBound

      The inclusive lower bound of the range.

      TValue upperBound

      The inclusive upper bound of the range.

      IComparer<TValue> comparer

      An IComparer<T> to use to compare values.

      Properties

      | Improve this Doc View Source

      LowerBound

      Gets the inclusive lower bound of the range.

      Declaration
      public TValue LowerBound { get; }
      Property Value
      Type Description
      TValue
      | Improve this Doc View Source

      UpperBound

      Gets the inclusive upper bound of the range.

      Declaration
      public TValue UpperBound { get; }
      Property Value
      Type Description
      TValue

      Methods

      | Improve this Doc View Source

      Contains(TValue)

      Tests whether a specified value falls within the range.

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

      The value to test.

      Returns
      Type Description
      Boolean

      true if value is between or equal to the lower and upper bound values of this instance; otherwise, false.

      | Improve this Doc View Source

      Equals(Range<TValue>)

      Returns a value indicating whether this instance has the same lower and upper bounds as a specified Range<TValue> object.

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

      The Range<TValue> object to compare to this instance.

      Returns
      Type Description
      Boolean

      true if other has the same lower and upper bounds as this instance; otherwise, false.

      | Improve this Doc View Source

      Equals(Object)

      Tests to see whether the specified object is a Range<TValue> object with the same lower and upper bounds as this Range<TValue> instance.

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

      The object to compare with this instance.

      Returns
      Type Description
      Boolean

      true if obj is a Range<TValue> and has the same lower and upper bounds as this Range<TValue>; otherwise, false.

      Overrides
      Object.Equals(Object)
      | Improve this Doc View Source

      GetHashCode()

      Returns a hash code for the current instance.

      Declaration
      public override int GetHashCode()
      Returns
      Type Description
      Int32

      The hash code for the current instance.

      Overrides
      Object.GetHashCode()
      | Improve this Doc View Source

      ToString()

      Creates a String representation of this Range<TValue>.

      Declaration
      public override string ToString()
      Returns
      Type Description
      String

      A String containing the lower and upper bound values of this Range<TValue>.

      Overrides
      Object.ToString()

      Operators

      | Improve this Doc View Source

      Equality(Range<TValue>, Range<TValue>)

      Tests whether two Range<TValue> objects are equal.

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

      The Range<TValue> object on the left-hand side of the equality operator.

      Range<TValue> right

      The Range<TValue> object on the right-hand side of the equality operator.

      Returns
      Type Description
      Boolean

      true if left and right have equal lower and upper bounds; otherwise, false.

      | Improve this Doc View Source

      Inequality(Range<TValue>, Range<TValue>)

      Tests whether two Range<TValue> objects are different.

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

      The Range<TValue> object on the left-hand side of the inequality operator.

      Range<TValue> right

      The Range<TValue> object on the right-hand side of the inequality operator.

      Returns
      Type Description
      Boolean

      true if left and right differ either in their lower or upper bounds; false if left and right are equal.

      Implements

      System.IEquatable<T>
      • Improve this Doc
      • View Source
      In This Article
      Back to top Generated by DocFX