Class
Range

Represents an inclusive integer range with a start and end index, used for row, column, and cell indexing operations.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.Core.DataStructures

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

cs-api-definition
public class Range

Inheritance: objectRange

Constructors

Range(int, int)

Initializes a new instance of the Range class with the specified start and end indices.

Declaration

cs-api-definition
public Range(int start, int end)

Parameters

start

int

The start.

end

int

The end.

Properties

End

Gets the inclusive ending index of the range.

Declaration

cs-api-definition
public int End { get; }

Property Value

int

The end.

Length

Gets the total number of indices covered by this range, calculated as (End - Start + 1).

Declaration

cs-api-definition
public long Length { get; }

Property Value

long

The length.

Start

Gets the inclusive starting index of the range.

Declaration

cs-api-definition
public int Start { get; }

Property Value

int

The start.

Methods

CreateOrExpand(Range, int)

Creates a new single-index range if the input range is null, or expands the existing range to include the specified index.

Declaration

cs-api-definition
public static Range CreateOrExpand(Range range, int index)

Parameters

range

Range

The range.

index

int

The index.

Returns

Range

The result range.

Expand(int)

Expands the range to include the specified index and returns the resulting range.

Declaration

cs-api-definition
public Range Expand(int index)

Parameters

index

int

The index.

Returns

Range

The expanded range.

Max(Range, Range)

Computes the maximum bounding range that encompasses both input ranges.

Declaration

cs-api-definition
public static Range Max(Range firstRange, Range secondRange)

Parameters

firstRange

Range

The first range.

secondRange

Range

The second range.

Returns

Range

The result range.

MaxOrNull(Range, Range)

Returns the maximum bounding range of two ranges, or null if both ranges are null.

Declaration

cs-api-definition
public static Range MaxOrNull(Range firstRange, Range secondRange)

Parameters

firstRange

Range

The first range.

secondRange

Range

The second range.

Returns

Range

The maximum range or null.

ToString()

Returns a string that represents the current object.

Declaration

cs-api-definition
public override string ToString()

Returns

string

A string that represents the current object.

Overrides object.ToString()