SheetRange Class
Definition
- Namespace
- GleamTech.DocumentUltimate
- Assembly
- GleamTech.DocumentUltimate.dll
Represents a range of sheet numbers.
[TypeConverter(typeof(StringTypeConverter))]
public class SheetRange : NumberRange
- Inheritance
-
SheetRange
Examples
Creating a SheetRange instance:
var sheetRange = new SheetRange("1-5");
//Same as above, SheetRange1 can be implicitly converted from a string
SheetRange sheetRange2 = "1-5";
Dim sheetRange As New SheetRange("1-5")
'Same as above, SheetRange1 can be implicitly converted from a string
Dim sheetRange2 As SheetRange = "1-5"
Remarks
The range is specified as a string in the following forms or combination thereof:
| 5 | single value |
| 1,2,3,4,5 | sequence of values |
| 1-5 | closed range |
| -5 | open range (converted to a sequence from 1 to 5) |
| 1- | open range (converted to a sequence from 1 to final sheet) |
| all | keyword representing all sheet numbers. |
| odd | keyword representing odd sheet numbers. |
| even | keyword representing even sheet numbers. |
| active | keyword representing the active sheet number. |
| visible | keyword 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.
Constructors
| SheetRange(string) |
Initializes a new instance of the SheetRange class from the specified string. |
Methods
| Add(int) |
Adds a single sheet number to the sequence. |
| Add(int?, int?) |
Adds a range of sheet numbers to the sequence. Reverse ordering is accepted. |
| Add(string) |
Adds a range of sheet numbers to the sequence from a string representation (e.g. 1-5, 8, 11-13). |
| Enumerate(int) |
Enumerates all the sheet numbers that this range instance describes. The sequence will be distinct and in ascending order. |
| MatchKeyword(string) |
Matches a supported keyword. It can be overriden in derived classed to support additional keywords. |
| Parse(string) |
Converts a string containing the range of sheet numbers to a SheetRange. |
| ToString() |
Converts this instance to a string containing the range of sheet numbers. |
Operators
| implicit operator SheetRange(string) |
Converts a string containing the range of sheet numbers to a SheetRange. |
| implicit operator string(SheetRange) |
Converts a SheetRange to a string containing the range of sheet numbers. |