PageRange

PageRange structure

Encapsulates one page range, which can have open or closed bounds. By default is “fully open” - it includes all existing pages. Page numbering starts from 1, not from 0.

public struct PageRange : IEquatable<PageRange>

Properties

Name Description
Count { get; } Numbers of pages within range. If 0 - page range spreads until end of the document no matter how much pages it consists of
EndNumber { get; } Exclusive end page number, until which this page range continues and on which is stops exclusively. If 0 - page range spreads until end of the document
IsDefault { get; } Indicates whether this instance represents a default “fully open” page range i.e. it represents all pages of a document (true) or not (false)
StartNumber { get; } Inclusive start page number, from which this page range starts. If 1 - page range starts from the first page of a document

Methods

Name Description
static FromBeginningWithCount(ushort) Creates a page range, that starts from the first page and has specified amount of pages
static FromStartPageTillEnd(ushort) Creates a page range, that starts from the specified page number and continues till the end of the document
static FromStartPageTillEndPage(ushort, ushort) Creates a page range, that starts from the specified page number (inclusively) and continues until the specified page number (exclusively)
static FromStartPageWithCount(ushort, ushort) Creates a page range, that starts from the specified page number and has specified amount of pages, or unlimited page count (till the end)
Equals(PageRange) Detects whether this instance of PageRange is equal to specified

Fields

Name Description
static readonly AllPages Represents all existing pages of a document. Default value.

Remarks

Immutable struct, that encapsulates a page range, which is not related to any specific document, and can represent a page range for any document.

See Also