[TypeConverterAttribute(typeof(StringTypeConverter))]
public class PageRange : NumberRange
<TypeConverterAttribute(GetType(StringTypeConverter))>
Public Class PageRange
Inherits NumberRange
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 page) |
all | keyword representing all page numbers. |
odd | keyword representing odd page numbers. |
even | keyword representing even page 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.
Creating a PageRange instance:
var pageRange = new PageRange("1-5");
//Same as above, PageRange can be implicitly converted from a string
PageRange pageRange2 = "1-5";
Dim pageRange As New PageRange("1-5")
'Same as above, PageRange can be implicitly converted from a string
Dim pageRange2 As PageRange = "1-5"
PageRange | Initializes a new instance of the PageRange class from the specified string. |
Add(Int32) | Adds a single page number to the sequence. (Overrides NumberRangeAdd(Int32)) |
Add(String) | Adds a range of page 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 page 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) |
Enumerate | Enumerates all the page 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.
(Inherited from NumberRange) |
Parse | Converts a string containing the range of page numbers to a PageRange. |
ToString | Converts this instance to a string containing the range of page numbers. (Overrides NumberRangeToString) |
(PageRange to String) | Converts a PageRange to a string containing the range of page numbers. |
(String to PageRange) | Converts a string containing the range of page numbers to a PageRange. |