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