OfficeSheetSelector
OfficeIMO.Excel
An immutable worksheet name, wildcard pattern, one-based position, or live worksheet identity.
Inheritance
- object
- OfficeSheetSelector
Usage
Explore 3 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.
Returned or exposed by 1
- Method OfficeSheetSelector.From
Accepted by parameters 2
Constructors
public OfficeSheetSelector(string? name = null, int? position = null) #JsonConstructorCreates a persistable name/pattern or position selector. Exactly one value is required.
Parameters
- name string? = null
- position int? = null
Methods
public static OfficeSheetSelector From(object value) #Creates a selector from a string, integral position, existing selector, or worksheet. Hosts unwrap their own argument wrappers first.
Parameters
- value object
Returns
OfficeSheetSelectorpublic static IReadOnlyList<ExcelSheet> ResolveMany(ExcelDocument document, IReadOnlyList<OfficeSheetSelector>? selectors, ExcelSheet? defaultSheet = null) #Resolves selectors once against the loaded workbook, deduplicating in workbook order. Names support case-insensitive *, ?, bracket sets/ranges and backtick escapes. Unmatched or empty explicit selections are errors. Null selects the supplied default worksheet or all worksheets.
Parameters
- document OfficeIMO.Excel.ExcelDocument
- selectors System.Collections.Generic.IReadOnlyList<OfficeIMO.Excel.OfficeSheetSelector>?
- defaultSheet OfficeIMO.Excel.ExcelSheet? = null
Returns
IReadOnlyList<ExcelSheet>public static IReadOnlyList<string> ResolveNames(IReadOnlyList<string> sheetNames, IReadOnlyList<OfficeSheetSelector>? selectors) #Resolves the same name/pattern and position selectors against an existing reader's worksheet names, without loading an editable workbook. Live worksheet identities require ResolveMany instead. Null selects all names; explicit empty or unmatched selections are errors. Results follow workbook order.
Parameters
- sheetNames System.Collections.Generic.IReadOnlyList<string>
- selectors System.Collections.Generic.IReadOnlyList<OfficeIMO.Excel.OfficeSheetSelector>?
Returns
IReadOnlyList<string>public T Resolve<T>(IReadOnlyList<T> sheets, Func<T, string> getName) #Resolves a literal name, position or live identity against a worksheet collection. Use ResolveMany for wildcard expansion.
Type Parameters
- T
Parameters
- sheets System.Collections.Generic.IReadOnlyList<T>
- getName System.Func<T, string>
Returns
TInherited Methods
Properties
public string? Name { get; } #Gets the name or wildcard pattern. A numeric string remains a name. Live selectors capture the name for persistence.
public int? Position { get; } #Gets the one-based worksheet position, resolved when the workbook is available.
public ExcelSheet? Sheet { get; } #JsonIgnoreGets the live worksheet identity. JSON persists its captured name without serializing the document.