Show / Hide Table of Contents

Struct Range<T>

A range of values.

Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: System.Windows.Controls.DataVisualization
Assembly: OpenSilver.Controls.DataVisualization.Toolkit.dll
Syntax
public struct Range<T>
    where T : IComparable
Type Parameters
Name Description
T

The type of the values.

Constructors

| Improve this Doc View Source

Range(T, T)

Initializes a new instance of the Range class.

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

The minimum value.

T maximum

The maximum value.

Properties

| Improve this Doc View Source

HasData

Gets a value indicating whether the range is empty or not.

Declaration
public readonly bool HasData { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Maximum

Gets the maximum value in the range.

Declaration
public readonly T Maximum { get; }
Property Value
Type Description
T
| Improve this Doc View Source

Minimum

Gets the minimum value in the range.

Declaration
public readonly T Minimum { get; }
Property Value
Type Description
T

Methods

| Improve this Doc View Source

Add(Range<T>)

Adds a range to the current range.

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

A range to add to the current range.

Returns
Type Description
Range<T>

A new range that encompasses the instance range and the range parameter.

| Improve this Doc View Source

Contains(T)

Returns a value indicating whether a value is within a range.

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

The value.

Returns
Type Description
System.Boolean

Whether the value is within the range.

| Improve this Doc View Source

Equals(Object)

Compares the range to an object.

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

Another object.

Returns
Type Description
System.Boolean

A value indicating whether the other object is a range, and if so, whether that range is equal to the instance range.

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

Equals(Range<T>)

Compares the range to another range.

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

A different range.

Returns
Type Description
System.Boolean

A value indicating whether the ranges are equal.

| Improve this Doc View Source

GetHashCode()

Computes a hash code value.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A hash code value.

Overrides
System.ValueType.GetHashCode()
| Improve this Doc View Source

IntersectsWith(Range<T>)

Returns a value indicating whether two ranges intersect.

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

The range to compare against this range.

Returns
Type Description
System.Boolean

A value indicating whether the ranges intersect.

| Improve this Doc View Source

ToString()

Returns the string representation of the range.

Declaration
public override string ToString()
Returns
Type Description
System.String

The string representation of the range.

Overrides
System.ValueType.ToString()

Operators

| Improve this Doc View Source

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

Compare two ranges and return a value indicating whether they are equal.

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

Left-hand side range.

Range<T> rightRange

Right-hand side range.

Returns
Type Description
System.Boolean

A value indicating whether the ranges are equal.

| Improve this Doc View Source

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

Compare two ranges and return a value indicating whether they are not equal.

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

Left-hand side range.

Range<T> rightRange

Right-hand side range.

Returns
Type Description
System.Boolean

A value indicating whether the ranges are not equal.

  • Improve this Doc
  • View Source