Table of Contents

Class DataRangeSet

Namespace
Ranorex.Core.Testing
Assembly
Ranorex.Core.dll

A class that represents a collection of DataRange. This class enables to specify a set of ranges e.g. '10-20,33,45-80,90'.

public class DataRangeSet : DataRange
Inheritance
DataRangeSet
Inherited Members

Constructors

DataRangeSet()

Instantiates a new DataRangeSet that will select all available rows.

public DataRangeSet()

DataRangeSet(IList<DataRange>)

Instantiates a new DataRangeSet with the given ranges.

public DataRangeSet(IList<DataRange> ranges)

Parameters

ranges IList<DataRange>

The ranges that will be contained in this set.

Exceptions

ArgumentNullException

If the ranges parameter is null.

Properties

MaxRange

The maximum value of any range contained in the set.

public override int MaxRange { get; set; }

Property Value

int

MinRange

The minimum value of any range contained in the set.

public override int MinRange { get; set; }

Property Value

int

Ranges

The ranges this set contains.

public IList<DataRange> Ranges { get; }

Property Value

IList<DataRange>

Methods

Equals(DataRangeSet)

Compares two data range sets if they are equal. Two range sets are equal if they contain the same ranges. The order of the ranges doesn't matter.

public bool Equals(DataRangeSet drs)

Parameters

drs DataRangeSet

The DataRangeSet to compare to.

Returns

bool

True if the ranges are equal, false otherwise.

Equals(object)

Compares the DataRangeSet to another object instance. Two ranges are equal if the contain the same ranges. The order of the ranges doesn't matter.

public override bool Equals(object obj)

Parameters

obj object

The object instance to compare to.

Returns

bool

True if the given object is an DataRangeSet and it is equal to this instance, false otherwise.

GetHashCode()

Returns a hash code for the DataRangeSet instance.

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.

Parse(string)

Parse a DataRangeSet from a given string. Valid strings are e.g. '10,20', '10-20,30-40' or '10,20,30,40-50,60-90,2'.

public static DataRangeSet Parse(string s)

Parameters

s string

The string to parse the DataRangeSet from.

Returns

DataRangeSet

A new DataRangeSet instance that contains the ranges parsed from s.

Exceptions

ArgumentNullException

If s is null.

ArgumentException

If s is empty or not a valid DataRangeSet string.

ToString()

Returns a string representation of the DataRangeSet, e.g. '10-20,32,54,60-920'.

public override string ToString()

Returns

string

A string representation of the DataRangeSet.

TryCreateFromIndices(int[])

Will create a new DataRangeSet from a list of given row indices. E.g. the indices '10,11,12,15,23,24' will result in the DataRangeSet '10-12,15,23-24'.

public static DataRangeSet TryCreateFromIndices(int[] indices)

Parameters

indices int[]

The indices to create the DataRangeSet from.

Returns

DataRangeSet

A new DataRangeSet if indices represents a valid range set, null otherwise.

TryParse(string)

Tries to parse a new DataRangeSet from a given string. This method never throws an exception.

public static DataRangeSet TryParse(string s)

Parameters

s string

The string to parse the DataRangeSet from.

Returns

DataRangeSet

A new DataRangeSet if parsing succeeded, null otherwise.