InterfaceIWorkbookFormatProvider
Defines a common interface for workbook import and export format providers, enabling serialization and deserialization of workbooks to and from various file formats.
Definition
Namespace:Telerik.Windows.Documents.Spreadsheet.FormatProviders
Assembly:Telerik.Windows.Documents.Spreadsheet.dll
Syntax:
public interface IWorkbookFormatProvider
Properties
CanExport
Gets a value indicating whether this provider supports exporting workbooks to streams.
Declaration
bool CanExport { get; }
Property Value
The value indicating whether can export.
CanImport
Gets a value indicating whether this provider supports importing workbooks from streams.
Declaration
bool CanImport { get; }
Property Value
The value indicating whether can import.
FilesDescription
Gets the human-readable description of files supported by this provider, suitable for display in file dialogs.
Declaration
string FilesDescription { get; }
Property Value
The files description.
Name
Gets the unique identifier name of this format provider.
SupportedExtensions
Gets the collection of file extensions supported by this provider, each including the leading dot (e.g., ".xlsx").
Declaration
IEnumerable<string> SupportedExtensions { get; }
Property Value
IEnumerable<string>
The supported extensions.
Methods
Export(Workbook, Stream)
Exports the specified workbook to the output stream in the provider's format.
Export(Workbook, Stream, TimeSpan?)
Exports the specified workbook to the output stream with an optional timeout in the provider's format.
Declaration
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.
Import(Stream)
Imports a workbook from the specified stream and returns the deserialized workbook instance.
Import(Stream, TimeSpan?)
Imports a workbook from the specified stream with an optional timeout and returns the deserialized workbook instance.
Declaration
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.