Struct Range<T>
A range of values.
Inherited Members
Namespace: System.Windows.Controls.DataVisualization
Assembly: Controls.DataVisualization.OpenSilver.dll
Syntax
public struct Range<T>
where T : IComparable
Type Parameters
Name | Description |
---|---|
T | The type of the values. |
Constructors
| Improve this Doc View SourceRange(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 SourceHasData
Gets a value indicating whether the range is empty or not.
Declaration
public readonly bool HasData { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Maximum
Gets the maximum value in the range.
Declaration
public readonly T Maximum { get; }
Property Value
Type | Description |
---|---|
T |
Minimum
Gets the minimum value in the range.
Declaration
public readonly T Minimum { get; }
Property Value
Type | Description |
---|---|
T |
Methods
| Improve this Doc View SourceAdd(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. |
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. |
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
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. |
GetHashCode()
Computes a hash code value.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code value. |
Overrides
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. |
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
Operators
| Improve this Doc View SourceEquality(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. |
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. |