ClassWorkbookFormatProviderBase
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:
public abstract class WorkbookFormatProviderBase : IWorkbookFormatProvider
Inheritance: objectWorkbookFormatProviderBase
Derived Classes:
Implements:
Constructors
WorkbookFormatProviderBase()
Initializes a new instance of the WorkbookFormatProviderBase class.
Declaration
protected WorkbookFormatProviderBase()
Properties
CanExport
Gets a value indicating whether this provider supports exporting workbooks to streams.
Declaration
public abstract bool CanExport { get; }
Property Value
The value indicating whether can export.
Implements
CanImport
Gets a value indicating whether this provider supports importing workbooks from streams.
Declaration
public abstract bool CanImport { get; }
Property Value
The value indicating whether can import.
Implements
FilesDescription
Gets the human-readable description of files supported by this provider, defaulting to the first extension in uppercase (e.g., "XLSX Files").
Declaration
public virtual string FilesDescription { get; }
Property Value
The files description.
Implements
Name
Gets the unique identifier name of this format provider.
Declaration
public abstract string Name { get; }
Property Value
The name of the provider.
Implements
SupportedExtensions
Gets the collection of file extensions supported by this provider, each including the leading dot.
Declaration
public abstract IEnumerable<string> SupportedExtensions { get; }
Property Value
The supported extensions.
Implements
Methods
Export(Workbook, Stream)
Exports the specified workbook to the output stream, validating export capability and workbook state.
Export(Workbook, Stream, TimeSpan?)
Exports the specified workbook to the output stream with an optional timeout, validating export capability and workbook state.
Declaration
public void Export(Workbook workbook, Stream output, TimeSpan? timeout)
Parameters
workbook
The workbook.
output
The output.
timeout
The timeout after which the operation will be cancelled.
Exceptions
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
ExportOverride(Workbook, Stream)
When overridden in a derived class, performs the format-specific export logic to serialize the workbook to the output stream.
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
protected virtual void ExportOverride(Workbook workbook, Stream output, CancellationToken cancellationToken)
Parameters
workbook
The workbook.
output
The output.
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.
Import(Stream, TimeSpan?)
Imports a workbook from the specified stream with an optional timeout, validating import capability, and returns the deserialized workbook instance.
Declaration
public Workbook Import(Stream input, TimeSpan? timeout)
Parameters
input
The input.
timeout
The timeout after which the operation will be cancelled.
Returns
The imported workbook.
Exceptions
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
ImportOverride(Stream)
When overridden in a derived class, performs the format-specific import logic to deserialize a workbook from the input stream.
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
protected virtual Workbook ImportOverride(Stream input, CancellationToken cancellationToken)
Parameters
input
The input.
cancellationToken
The token used to cancel the operation.
Returns
The imported workbook.