Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OfficePageSelector

OfficeIMO

Namespace
OfficeIMO
Assembly
OfficeIMO.Core
Source revision
ac7e6e1bad8a with working tree changes
Implements
IEquatable<OfficePageSelector>
Modifiers
sealed

Represents a document-relative, caller-ordered page selection expression.

Inheritance

  • object
  • OfficePageSelector

Remarks

Selectors are resolved against a document page count. Supported terms include absolute pages and ranges (1, 1-3, 5..2), end-relative pages (last, last-2), all, odd, even, and exclusions prefixed with !.

Usage

Explore 4 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 2

Methods

Equals 2 overloads
public bool Equals(OfficePageSelector? other) #

Indicates whether the current object is equal to another object of the same type.

Parameters

other OfficeIMO.OfficePageSelector? required
An object to compare with this object.

Returns

bool true if the current object is equal to the other parameter; otherwise, false.
public override bool Equals(object? obj) #

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

Parameters

obj object? required
The object to compare with the current object.

Returns

bool true if the specified object is equal to the current object; otherwise, false.
public override int GetHashCode() #

Serves as the default hash function.

Returns

int A hash code for the current object.
public static OfficePageSelector Parse(string expression) #

Parses a document-relative page selector.

Parameters

expression string required
Resolve 2 overloads
public IReadOnlyList<int> Resolve(int pageCount) #

Resolves the selector to caller-ordered, one-based page numbers.

Parameters

pageCount int required

Returns

IReadOnlyList<int>
public IReadOnlyList<int> Resolve(int pageCount, int maximumPages) #

Resolves the ordered selection, rejecting it before retaining more than the supplied page budget.

Parameters

pageCount int required
maximumPages int required

Returns

IReadOnlyList<int>
public override string ToString() #

Returns a string that represents the current object.

Returns

string A string that represents the current object.
public static bool TryParse(string? expression, out OfficePageSelector? selector) #

Attempts to parse a document-relative page selector.

Parameters

expression string? required
selector OfficeIMO.OfficePageSelector? required

Returns

bool

Properties

public string Expression { get; } #

Original normalized selector expression.