New to Telerik UI for WPFStart a free 30-day trial

Represents a structure that defines a range of two IComparable structures - like Single or Double.

Definition

Namespace:Telerik.Charting

Assembly:Telerik.Windows.Controls.Chart.dll

Type Parameters:

T

Must implement the IComparable interface.

Syntax:

C#
public struct ValueRange<T> where T : struct, IComparable<T>

Inherited Members ValueType.ToString()

Constructors

Initializes a new instance of the ValueRange<T> struct.

C#
public ValueRange(T min, T max)
Parameters:minT

The minimum value.

maxT

The maximum value.

Fields

Empty value range where minimum and maximum are set to their default(T) value.

C#
public static readonly ValueRange<T> Empty

Properties

Gets or sets the maximum value of the range.

C#
public T Maximum { get; set; }

Gets or sets the minimum value of the range.

C#
public T Minimum { get; set; }

Methods

Determines whether the specified object is equal to this instance.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with this instance.

Returns:

bool

true if the specified object is equal to this instance; otherwise, false.

Overrides: ValueType.Equals(object)

Returns a hash code for this instance.

C#
public override int GetHashCode()
Returns:

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Overrides: ValueType.GetHashCode()

Determines whether the specified value is within the range, excluding its minimum and maximum values.

C#
public bool IsInRangeExclusive(T value)
Parameters:valueT

The tested value.

Returns:

bool

true if the value is within the range, excluding its minimum and maximum; otherwise, false.

Determines whether the specified value is within the range, including its minimum and maximum values.

C#
public bool IsInRangeInclusive(T value)
Parameters:valueT

The tested value.

Returns:

bool

true if the value is within the range, including its minimum and maximum; otherwise, false.

Operators

Determines whether two ranges are not equal.

C#
public static bool operator !=(ValueRange<T> range1, ValueRange<T> range2)
Parameters:range1ValueRange<T>

The first range.

range2ValueRange<T>

The second range.

Returns:

bool

true if the operands are not equal; otherwise, false.

Determines whether two ranges are not equal.

C#
public static bool operator ==(ValueRange<T> range1, ValueRange<T> range2)
Parameters:range1ValueRange<T>

The first range.

range2ValueRange<T>

The second range.

Returns:

bool

true if the operands are equal; otherwise, false.