[]
Describes a part of the document (pages or objects) that is to be exported or printed. Note: all page numbers are 1-based.
public class OutputRange : IEnumerable<int>, IEnumerable
Creates an instance of OutputRange that includes a single interval of pages.
public OutputRange(int fromPage, int toPage, bool inverted)
fromPage
intThe number of the first page to include (1-based).
toPage
intThe number of the last page to include (1-based).
inverted
boolIndicates whether the range should be inverted, see Inverted for details.
Creates an instance of OutputRange that includes a single interval of pages. FromPage may be greater than ToPage, in that case the range is inverted.
public OutputRange(int fromPage, int toPage)
fromPage
intThe number of the first page to include (1-based).
toPage
intThe number of the last page to include (1-based).
Creates an instance of OutputRange that includes all pages with numbers specified in the list.
public OutputRange(int[] pageNumbers, bool inverted)
pageNumbers
int[]The array of page numbers to include.
inverted
boolIndicates whether the range should be inverted, see Inverted for details.
Creates an instance of OutputRange that includes all pages with numbers specified in the list.
public OutputRange(int[] pageNumbers)
pageNumbers
int[]The array of page numbers to include.
Creates an instance of OutputRange that includes pages specified by the string parameter. The string may contain:
public OutputRange(string pages, bool inverted)
pages
stringThe pages to be included.
inverted
boolIndicates whether the range should be inverted, see Inverted for details.
Creates an instance of OutputRange that includes pages specified by the string parameter. The string may contain:
public OutputRange(string pages)
pages
stringThe pages to be included.
Represents an all-inclusive range.
public static readonly OutputRange All
Represents an all-inclusive range with inverted order.
public static readonly OutputRange AllInverted
Gets the first page in the range.
public int FromPage { get; }
Gets the value indicating whether the range should be inverted. If the range is inverted, the range's iterator goes from the end of the range backwards.
public bool Inverted { get; }
True if the range is inverted, false otherwise.
Gets the last page in the range.
public int ToPage { get; }
Type of range: all pages, range of pages etc.
public OutputRangeType Type { get; }
Tests whether the specified page is within the range.
public bool Contains(int pageNumber)
pageNumber
intThe page number to test.
True if the page is in the range, false otherwise.
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
obj
objectThe object to compare with the current object.
true if the specified object is equal to the current object; otherwise, false.
Creates and returns a new enumerator that allows looping through all pages in the range.
public IEnumerator<int> GetEnumerator()
The new enumerator.
Creates and returns a new enumerator that allows looping through all pages in the range.
public IEnumerator<int> GetEnumerator(int minPageNumber, int maxPageNumber)
minPageNumber
intThe starting page number (used if the current range is from the beginning of a document).
maxPageNumber
intThe ending page number (used if the current range is to the end of a document).
The new enumerator.
Creates and returns a new enumerator that allows looping through all pages in the range.
public IEnumerator<int> GetEnumerator(int maxPageNumber)
maxPageNumber
intThe ending page number (used if the current range is to the end of a document).
The new enumerator.
Serves as the default hash function.
public override int GetHashCode()
A hash code for the current object.
Gets the ending page number of the current range.
public int GetMaxPage(int maxPageNumber)
maxPageNumber
intThe ending page number (used if the current range is to the end of a document).
The actual ending page number.
Gets the starting page number of the current range.
public int GetMinPage(int minPageNumber)
minPageNumber
intThe starting page number (used if the current range is from the beginning of a document).
The actual starting page number.
Gets the page number of a page with a specified index within the current range.
public int GetPage(int pageIndex, int minPageNumber, int maxPageNumber)
pageIndex
intThe 0-based page index.
minPageNumber
intThe starting page number (used if the current range is from the beginning of a document).
maxPageNumber
intThe ending page number (used if the current range is to the end of a document).
Gets the total number of pages in the current range.
public int GetPageCount(int minPageNumber, int maxPageNumber)
minPageNumber
intThe starting page number (used if the current range is from the beginning of a document).
maxPageNumber
intThe ending page number (used if the current range is to the end of a document).
Tests whether page numbers specified by the current OutputRange fall within a specified range.
public bool InRange(int minPageNumber, int maxPageNumber)
minPageNumber
intThe starting page number (used if the current range is from the beginning of a document).
maxPageNumber
intThe ending page number (used if the current range is to the end of a document).
Returns a string that represents the current OutputRange.
public override string ToString()
A string that represents the range.
Tries to parse specified string and create OutputRange object from it.
public static bool TryParse(string s, out OutputRange range)
s
stringThe string to parse.
range
OutputRangeOUT: The created OutputRange object or null if string does not define OutputRange object.
Returns true if string was successfully parsed, false otherwise.