Table of Contents

Struct XlsSheet

Namespace
ExcelReader.Core.Reader.Xls
Assembly
ExcelReader.Core.dll

One sheet of an XlsWorkbook. A value that holds no resources; each enumerator it creates reads independently.

public readonly record struct XlsSheet : IExcelSheet, IExcelSheet<IExcelRowEnumerator>, IExcelSheet<XlsWorkbook.Enumerator>, IEquatable<XlsSheet>
Implements
Inherited Members
Extension Methods

Properties

Index

Gets the sheet's zero-based position in its workbook.

public int Index { get; }

Property Value

int

IsDate1904

Gets a value indicating whether the sheet's workbook uses the 1904 date system.

public bool IsDate1904 { get; }

Property Value

bool

Name

Gets the sheet's name. Empty for the single sheet of a CSV source.

public string Name { get; }

Property Value

string

Visibility

Gets whether the sheet is shown in the workbook's tab bar.

public ExcelSheetVisibility Visibility { get; }

Property Value

ExcelSheetVisibility

Remarks

Reported, never enforced: a hidden sheet enumerates its rows like any other.

Methods

GetAsyncEnumerator(CancellationToken)

Gets a new enumerator that reads the sheet's rows asynchronously from the start.

public XlsWorkbook.Enumerator GetAsyncEnumerator(CancellationToken ct = default)

Parameters

ct CancellationToken

A token checked by this call and by every MoveNextAsync() call.

Returns

XlsWorkbook.Enumerator

Remarks

XlsWorkbook is fully in-memory, so nothing is deferred; ct is checked here and on each move.

Exceptions

ObjectDisposedException

The sheet's workbook was disposed.

GetEnumerator()

Gets a new enumerator that reads the sheet's rows synchronously from the start.

public XlsWorkbook.Enumerator GetEnumerator()

Returns

XlsWorkbook.Enumerator

Exceptions

ObjectDisposedException

The sheet's workbook was disposed.

InvalidOperationException

The source is a CSV over a non-seekable stream that was already enumerated.