[]
        
(Showing Draft Content)

GrapeCity.Documents.Common.OutputRange

Class OutputRange

Namespace
GrapeCity.Documents.Common
Assembly
GcDocs.Imaging.dll

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
Inheritance
object
OutputRange
Implements
System.Collections.Generic.IEnumerable<T><int>
System.Collections.IEnumerable
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
object.MemberwiseClone()

Constructors

OutputRange(int, int, bool)

Creates an instance of OutputRange that includes a single interval of pages.

public OutputRange(int fromPage, int toPage, bool inverted)

Parameters

fromPage int

The number of the first page to include (1-based).

toPage int

The number of the last page to include (1-based).

inverted bool

Indicates whether the range should be inverted, see Inverted for details.

OutputRange(int, int)

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)

Parameters

fromPage int

The number of the first page to include (1-based).

toPage int

The number of the last page to include (1-based).

OutputRange(int[], bool)

Creates an instance of OutputRange that includes all pages with numbers specified in the list.

public OutputRange(int[] pageNumbers, bool inverted)

Parameters

pageNumbers int[]

The array of page numbers to include.

inverted bool

Indicates whether the range should be inverted, see Inverted for details.

OutputRange(int[])

Creates an instance of OutputRange that includes all pages with numbers specified in the list.

public OutputRange(int[] pageNumbers)

Parameters

pageNumbers int[]

The array of page numbers to include.

OutputRange(string, bool)

Creates an instance of OutputRange that includes pages specified by the string parameter. The string may contain:

  • page numbers (1-based) separated by commas;
  • dashes ('-') to specify intervals (a dash at the end implies infinity).
public OutputRange(string pages, bool inverted)

Parameters

pages string

The pages to be included.

inverted bool

Indicates whether the range should be inverted, see Inverted for details.

OutputRange(string)

Creates an instance of OutputRange that includes pages specified by the string parameter. The string may contain:

  • page numbers (1-based) separated by commas;
  • dashes ('-') to specify intervals (a dash at the end implies infinity).
public OutputRange(string pages)

Parameters

pages string

The pages to be included.

Fields

All

Represents an all-inclusive range.

public static readonly OutputRange All

Field Value

OutputRange

AllInverted

Represents an all-inclusive range with inverted order.

public static readonly OutputRange AllInverted

Field Value

OutputRange

Properties

FromPage

Gets the first page in the range.

public int FromPage { get; }

Property Value

int

Inverted

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; }

Property Value

bool

True if the range is inverted, false otherwise.

ToPage

Gets the last page in the range.

public int ToPage { get; }

Property Value

int

Type

Type of range: all pages, range of pages etc.

public OutputRangeType Type { get; }

Property Value

OutputRangeType

Methods

Contains(int)

Tests whether the specified page is within the range.

public bool Contains(int pageNumber)

Parameters

pageNumber int

The page number to test.

Returns

bool

True if the page is in the range, false otherwise.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetEnumerator()

Creates and returns a new enumerator that allows looping through all pages in the range.

public IEnumerator<int> GetEnumerator()

Returns

System.Collections.Generic.IEnumerator<T><int>

The new enumerator.

GetEnumerator(int, int)

Creates and returns a new enumerator that allows looping through all pages in the range.

public IEnumerator<int> GetEnumerator(int minPageNumber, int maxPageNumber)

Parameters

minPageNumber int

The starting page number (used if the current range is from the beginning of a document).

maxPageNumber int

The ending page number (used if the current range is to the end of a document).

Returns

System.Collections.Generic.IEnumerator<T><int>

The new enumerator.

GetEnumerator(int)

Creates and returns a new enumerator that allows looping through all pages in the range.

public IEnumerator<int> GetEnumerator(int maxPageNumber)

Parameters

maxPageNumber int

The ending page number (used if the current range is to the end of a document).

Returns

System.Collections.Generic.IEnumerator<T><int>

The new enumerator.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetMaxPage(int)

Gets the ending page number of the current range.

public int GetMaxPage(int maxPageNumber)

Parameters

maxPageNumber int

The ending page number (used if the current range is to the end of a document).

Returns

int

The actual ending page number.

GetMinPage(int)

Gets the starting page number of the current range.

public int GetMinPage(int minPageNumber)

Parameters

minPageNumber int

The starting page number (used if the current range is from the beginning of a document).

Returns

int

The actual starting page number.

GetPage(int, int, int)

Gets the page number of a page with a specified index within the current range.

public int GetPage(int pageIndex, int minPageNumber, int maxPageNumber)

Parameters

pageIndex int

The 0-based page index.

minPageNumber int

The starting page number (used if the current range is from the beginning of a document).

maxPageNumber int

The ending page number (used if the current range is to the end of a document).

Returns

int

GetPageCount(int, int)

Gets the total number of pages in the current range.

public int GetPageCount(int minPageNumber, int maxPageNumber)

Parameters

minPageNumber int

The starting page number (used if the current range is from the beginning of a document).

maxPageNumber int

The ending page number (used if the current range is to the end of a document).

Returns

int

InRange(int, int)

Tests whether page numbers specified by the current OutputRange fall within a specified range.

public bool InRange(int minPageNumber, int maxPageNumber)

Parameters

minPageNumber int

The starting page number (used if the current range is from the beginning of a document).

maxPageNumber int

The ending page number (used if the current range is to the end of a document).

Returns

bool

ToString()

Returns a string that represents the current OutputRange.

public override string ToString()

Returns

string

A string that represents the range.

TryParse(string, out OutputRange)

Tries to parse specified string and create OutputRange object from it.

public static bool TryParse(string s, out OutputRange range)

Parameters

s string

The string to parse.

range OutputRange

OUT: The created OutputRange object or null if string does not define OutputRange object.

Returns

bool

Returns true if string was successfully parsed, false otherwise.