SheetRange Class

Represents a range of sheet numbers.

Definition

Namespace: GleamTech.DocumentUltimate
Assembly: GleamTech.DocumentUltimate (in GleamTech.DocumentUltimate.dll) Version: 7.2.0
C#
[TypeConverterAttribute(typeof(StringTypeConverter))]
public class SheetRange : NumberRange
Inheritance
Object    NumberRange    SheetRange

Remarks

The range is specified as a string in the following forms or combination thereof:

5single value
1,2,3,4,5sequence of values
1-5closed range
-5open range (converted to a sequence from 1 to 5)
1-open range (converted to a sequence from 1 to final sheet)
allkeyword representing all sheet numbers.
oddkeyword representing odd sheet numbers.
evenkeyword representing even sheet numbers.
activekeyword representing the active sheet number.
visiblekeyword representing visible sheet numbers.

The value delimiter can be either ',' or ';' and the range separator can be either '-' or ':'. Whitespace is permitted at any point in the input.

Any elements of the sequence that contain non-digit, non-whitespace, or non-separator characters or that are empty are ignored.

Example

Creating a SheetRange instance:

C#
var sheetRange = new SheetRange("1-5");

//Same as above, SheetRange1 can be implicitly converted from a string
SheetRange sheetRange2 = "1-5";

Constructors

SheetRange Initializes a new instance of the SheetRange class from the specified string.

Methods

Add(Int32)Adds a single sheet number to the sequence.
(Overrides NumberRangeAdd(Int32))
Add(String)Adds a range of sheet numbers to the sequence from a string representation (e.g. 1-5, 8, 11-13).
(Overrides NumberRangeAdd(String))
Add(NullableInt32, NullableInt32)Adds a range of sheet numbers to the sequence. Reverse ordering is accepted.
(Overrides NumberRangeAdd(NullableInt32, NullableInt32))
Contains Determines whether this instance contains the specified range part (number range or keyword).
(Inherited from NumberRange)
EnumerateEnumerates all the sheet numbers that this range instance describes. The sequence will be distinct and in ascending order.
(Overrides NumberRangeEnumerate(Int32))
ExpandKeyword Expands a supported keyword to an enumerable sequence of numbers. It can be overriden in derived classed to support additional keywords.
(Inherited from NumberRange)
MatchKeyword Matches a supported keyword. It can be overriden in derived classed to support additional keywords.
(Overrides NumberRangeMatchKeyword(String))
Parse Converts a string containing the range of sheet numbers to a SheetRange.
ToStringConverts this instance to a string containing the range of sheet numbers.
(Overrides NumberRangeToString)

Operators

(SheetRange to String) Converts a SheetRange to a string containing the range of sheet numbers.
(String to SheetRange) Converts a string containing the range of sheet numbers to a SheetRange.

See Also