Table of Contents

Class DataRange

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

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

minRange int

The minimum range.

maxRange int

The maximum range.

Properties

FullRange

Returns a DataRange instance that will select all available datarows.

public static DataRange FullRange { get; }

Property Value

DataRange

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)

Compares the DataRange to another DataRange.

public bool Equals(DataRange range)

Parameters

range DataRange

The DataRange to compare to.

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

obj object

The DataRange to compare to.

Returns

bool

True if obj is of type DataRange and the instances are equal, false otherwise.

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

s string

The string to parse the datarange from.

Returns

DataRange

A new DataRange instance if parsing succeeded, null otherwise.

Exceptions

ArgumentNullException

If s is null.

ArgumentException

If s is 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

indices int[]

The indices that should be used to create the DataRange instance.

Returns

DataRange

A new DataRange instance if the indices represent a contineous range, null otherwise.

TryParse(string)

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

public static DataRange TryParse(string s)

Parameters

s string

The string to parse the datarange from.

Returns

DataRange

The parsed DataRange instance if parsing succeeded, null otherwise.