Class DataRange
Specifies the minimum range and maximum range of the used DataContext instance.
public class DataRange
- Inheritance
-
DataRange
- Derived
- Inherited Members
Constructors
DataRange()
protected DataRange()
DataRange(int, int)
Initializes a new instance of the DataRange.class.
public DataRange(int minRange, int maxRange)
Parameters
Properties
FullRange
Returns a DataRange instance that will select all available datarows.
public static DataRange FullRange { get; }
Property Value
MaxRange
Gets or sets the maximum range.
public virtual int MaxRange { get; set; }
Property Value
- int
The maximum range.
MinRange
Gets or sets the minimum range.
public virtual int MinRange { get; set; }
Property Value
- int
The minimum range.
Methods
Equals(DataRange)
public bool Equals(DataRange range)
Parameters
Returns
- bool
True if the instances are equal, false otherwise.
Equals(object)
Compares the DataRange to another object instance.
public override bool Equals(object obj)
Parameters
Returns
GetHashCode()
Returnes a hashcode for this object instance.
public override int GetHashCode()
Returns
- int
A hashcode for this object instance.
Parse(string)
Parses a DataRange from a given string.
public static DataRange Parse(string s)
Parameters
sstringThe string to parse the datarange from.
Returns
Exceptions
- ArgumentNullException
If
sis null.- ArgumentException
If
sis empty or has an invalid format that doesnt represent a DataRange.
ToString()
Create a string representation of the DataRange.
public override string ToString()
Returns
- string
The string represenation fo the DataRange, e.g. '10' or '10-22'
TryCreateFromIndices(int[])
Creates a DataRange from a set of indices. The method will check if the indices represent a contineous range and if so will return this range. E.g. '10,11,12' will return the range '10-12' but the indices '10,12' will return null.
public static DataRange TryCreateFromIndices(int[] indices)
Parameters
Returns
TryParse(string)
Tries to parse a DataRange from a given string. This method never throws an exception.
public static DataRange TryParse(string s)
Parameters
sstringThe string to parse the datarange from.