Class
WorkbookFormatProviderBase

Base class for all workbook format providers, implementing common import and export logic with timeout and cancellation support.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.FormatProviders

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

cs-api-definition
public abstract class WorkbookFormatProviderBase : IWorkbookFormatProvider

Inheritance: objectWorkbookFormatProviderBase

Derived Classes: BinaryWorkbookFormatProviderBaseTextBasedWorkbookFormatProviderBase

Implements: IWorkbookFormatProvider

Constructors

WorkbookFormatProviderBase()

Initializes a new instance of the WorkbookFormatProviderBase class.

Declaration

cs-api-definition
protected WorkbookFormatProviderBase()

Properties

CanExport

Gets a value indicating whether this provider supports exporting workbooks to streams.

Declaration

cs-api-definition
public abstract bool CanExport { get; }

Property Value

bool

The value indicating whether can export.

Implements IWorkbookFormatProvider.CanExport

CanImport

Gets a value indicating whether this provider supports importing workbooks from streams.

Declaration

cs-api-definition
public abstract bool CanImport { get; }

Property Value

bool

The value indicating whether can import.

Implements IWorkbookFormatProvider.CanImport

FilesDescription

Gets the human-readable description of files supported by this provider, defaulting to the first extension in uppercase (e.g., "XLSX Files").

Declaration

cs-api-definition
public virtual string FilesDescription { get; }

Property Value

string

The files description.

Implements IWorkbookFormatProvider.FilesDescription

Name

Gets the unique identifier name of this format provider.

Declaration

cs-api-definition
public abstract string Name { get; }

Property Value

string

The name of the provider.

Implements IWorkbookFormatProvider.Name

SupportedExtensions

Gets the collection of file extensions supported by this provider, each including the leading dot.

Declaration

cs-api-definition
public abstract IEnumerable<string> SupportedExtensions { get; }

Property Value

IEnumerable<string>

The supported extensions.

Implements IWorkbookFormatProvider.SupportedExtensions

Methods

Export(Workbook, Stream)

Exports the specified workbook to the output stream, validating export capability and workbook state.

Declaration

cs-api-definition
[Obsolete("This method is obsolete. Please use Export(Workbook workbook, Stream output, TimeSpan? timeout) instead.")]
public void Export(Workbook workbook, Stream output)

Parameters

workbook

Workbook

The workbook.

output

Stream

The output.

Implements IWorkbookFormatProvider.Export(Workbook, Stream)

Export(Workbook, Stream, TimeSpan?)

Exports the specified workbook to the output stream with an optional timeout, validating export capability and workbook state.

Declaration

cs-api-definition
public void Export(Workbook workbook, Stream output, TimeSpan? timeout)

Parameters

workbook

Workbook

The workbook.

output

Stream

The output.

timeout

TimeSpan?

The timeout after which the operation will be cancelled.

Exceptions

ArgumentOutOfRangeException

The exception that is thrown when timeout is less than -1 or greater than Int32.MaxValue. Note that this upper bound is more restrictive than TimeSpan.MaxValue.

Implements IWorkbookFormatProvider.Export(Workbook, Stream, TimeSpan?)

ExportOverride(Workbook, Stream)

When overridden in a derived class, performs the format-specific export logic to serialize the workbook to the output stream.

Declaration

cs-api-definition
[Obsolete("Use ExportOverride(Workbook workbook, Stream output, CancellationToken cancellationToken) instead.")]
protected virtual void ExportOverride(Workbook workbook, Stream output)

Parameters

workbook

Workbook

The workbook.

output

Stream

The output.

ExportOverride(Workbook, Stream, CancellationToken)

When overridden in a derived class, performs the format-specific export logic to serialize the workbook to the output stream with cancellation support.

Declaration

cs-api-definition
protected virtual void ExportOverride(Workbook workbook, Stream output, CancellationToken cancellationToken)

Parameters

workbook

Workbook

The workbook.

output

Stream

The output.

cancellationToken

CancellationToken

The token used to cancel the operation.

Import(Stream)

Imports a workbook from the specified stream, validating import capability, and returns the deserialized workbook instance.

Declaration

cs-api-definition
[Obsolete("This method is obsolete. Please use Import(Stream input, TimeSpan? timeout) instead.")]
public Workbook Import(Stream input)

Parameters

input

Stream

The input.

Returns

Workbook

The imported workbook.

Implements IWorkbookFormatProvider.Import(Stream)

Import(Stream, TimeSpan?)

Imports a workbook from the specified stream with an optional timeout, validating import capability, and returns the deserialized workbook instance.

Declaration

cs-api-definition
public Workbook Import(Stream input, TimeSpan? timeout)

Parameters

input

Stream

The input.

timeout

TimeSpan?

The timeout after which the operation will be cancelled.

Returns

Workbook

The imported workbook.

Exceptions

ArgumentOutOfRangeException

The exception that is thrown when timeout is less than -1 or greater than Int32.MaxValue. Note that this upper bound is more restrictive than TimeSpan.MaxValue.

Implements IWorkbookFormatProvider.Import(Stream, TimeSpan?)

ImportOverride(Stream)

When overridden in a derived class, performs the format-specific import logic to deserialize a workbook from the input stream.

Declaration

cs-api-definition
[Obsolete("Use ImportOverride(Stream input, CancellationToken cancellationToken) instead.")]
protected virtual Workbook ImportOverride(Stream input)

Parameters

input

Stream

The input.

Returns

Workbook

The imported workbook.

ImportOverride(Stream, CancellationToken)

When overridden in a derived class, performs the format-specific import logic to deserialize a workbook from the input stream with cancellation support.

Declaration

cs-api-definition
protected virtual Workbook ImportOverride(Stream input, CancellationToken cancellationToken)

Parameters

input

Stream

The input.

cancellationToken

CancellationToken

The token used to cancel the operation.

Returns

Workbook

The imported workbook.