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> where T : IComparable<T>
Type Parameters
| Name | Description |
|---|---|
| T | The type of the minimum and maximum values. |
Remarks
See also System.IEquatable<T> of Range<T>
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 |
|---|---|
| bool |
|
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 |
|---|---|
| bool |
|
Equals(object?)
Determines whether the specified object, is equal to this instance.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with this instance. |
Returns
| Type | Description |
|---|---|
| bool |
|
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 |
|---|---|
| bool | true if the current object is equal to the |
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 |
|---|---|
| bool |
|
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | 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 |
|---|---|
| bool |
|
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 |
|---|---|
| bool |
|
ToString()
Returns a string that represents this instance.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents this instance. |
ToString(string, IFormatProvider?)
Returns a string that represents this instance.
Declaration
public string ToString(string format, IFormatProvider? provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | format | A composite format string for the range values. Use {0} for the minimum and {1} for the maximum value. |
| IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| string | A string that represents this instance. |
ToString(string, string, IFormatProvider?)
Returns a string that represents this instance.
Declaration
public string ToString(string format, string formatRange, IFormatProvider? provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| 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. |
| string | formatRange | A composite format string for the range values. Use {0} for the minimum and {1} for the maximum value. |
| IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
| Type | Description |
|---|---|
| string | A string that represents this instance. |