Class Range<T>
Represents a range with a minimum and maximum value.
Inheritance
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
public class Range<T> : IEquatable<Range<T>> where T : IComparable<T>Type Parameters
| Name | Description | 
|---|---|
| T | The type of the minimum and maximum values. | 
Remarks
See also 
Properties
View SourceMaximum
Gets or sets the maximum value.
Declaration
public T Maximum { get; set; }Property Value
| Type | Description | 
|---|---|
| T | The maximum value. | 
Minimum
Gets or sets the minimum value.
Declaration
public T Minimum { get; set; }Property Value
| Type | Description | 
|---|---|
| T | The minimum value. | 
Methods
View SourceContainsRange(Range<T>)
Determines whether this range contains the specified range.
Declaration
public bool ContainsRange(Range<T> range)Parameters
| Type | Name | Description | 
|---|---|---|
| Range<T> | range | The range. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
 | 
ContainsValue(T)
Determines whether this range contains the specified value.
Declaration
public bool ContainsValue(T value)Parameters
| Type | Name | Description | 
|---|---|---|
| T | value | The value. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
 | 
Equals(T, T)
Determines whether the specified minimum and maximum values are equal to
this instance values.
Declaration
public bool Equals(T minimum, T maximum)Parameters
| Type | Name | Description | 
|---|---|---|
| T | minimum | The minimum value. | 
| T | maximum | The maximum value. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
 | 
Equals(Object)
Determines whether the specified System.Object, is equal to this instance.
Declaration
public override bool Equals(object obj)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Object | obj | The System.Object to compare with this instance. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
 | 
Equals(Range<T>)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(Range<T> other)Parameters
| Type | Name | Description | 
|---|---|---|
| Range<T> | other | An object to compare with this object. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | true if the current object is equal to the  | 
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()Returns
| Type | Description | 
|---|---|
| System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. | 
IsInsideRange(Range<T>)
Determines whether this range is inside the specified range.
Declaration
public bool IsInsideRange(Range<T> range)Parameters
| Type | Name | Description | 
|---|---|---|
| Range<T> | range | The range. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
 | 
IsValid()
Determines whether this range is valid (the minimum value is lower than or equal to the maximum value).
Declaration
public bool IsValid()Returns
| Type | Description | 
|---|---|
| System.Boolean | 
 | 
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()Returns
| Type | Description | 
|---|---|
| System.String | A System.String that represents this instance. | 
ToString(String, Nullable<IFormatProvider>)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format, IFormatProvider? provider = null)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | format | A composite format string for the range values. Use {0} for the minimum and {1} for the maximum value. | 
| System.Nullable<IFormatProvider> | provider | An object that supplies culture-specific formatting information. | 
Returns
| Type | Description | 
|---|---|
| System.String | A System.String that represents this instance. | 
ToString(String, String, Nullable<IFormatProvider>)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format, string formatRange, IFormatProvider? provider = null)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | format | A composite format string for a single value (minimum and maximum are equal). Use {0} for the minimum and {1} for the maximum value. | 
| System.String | formatRange | A composite format string for the range values. Use {0} for the minimum and {1} for the maximum value. | 
| System.Nullable<IFormatProvider> | provider | An object that supplies culture-specific formatting information. | 
Returns
| Type | Description | 
|---|---|
| System.String | A System.String that represents this instance. |