Manages the global registry of workbook format providers, enabling registration, discovery by extension, and import/export operations using the registered providers.
Definition
Namespace:Telerik.Windows.Documents.Spreadsheet.FormatProviders
Assembly:Telerik.Windows.Documents.Spreadsheet.dll
Syntax:
public class WorkbookFormatProvidersManager
Inheritance: objectWorkbookFormatProvidersManager
Methods
Exports a workbook to a stream with an optional timeout using a provider from the specified collection that supports the file extension.
public static void Export(Workbook workbook, string extension, Stream output, IEnumerable<IWorkbookFormatProvider> formatProviders, TimeSpan? timeout)
The workbook.
extensionstringThe file extension.
outputStreamThe output stream.
formatProvidersIEnumerable<IWorkbookFormatProvider>The format providers to be used.
timeoutTimeSpan?The timeout after which the operation will be cancelled.
Exceptions:UnsupportedFileFormatException
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.
Exports a workbook to a stream with an optional timeout using the format provider registered for the specified file extension.
public static void Export(Workbook workbook, string extension, Stream output, TimeSpan? timeout)
The workbook.
extensionstringThe file extension.
outputStreamThe output stream.
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.
Retrieves the format provider that supports the specified file extension from the registered providers, or null if not found.
public static IWorkbookFormatProvider GetProviderByExtension(string extension)
The extension.
Returns:The format provider.
Retrieves the format provider with the specified name from the registered providers, or null if not found.
public static IWorkbookFormatProvider GetProviderByName(string providerName)
Name of the provider.
Returns:The format provider.
Enumerates all unique file extensions supported by registered format providers for import or export.
public static IEnumerable<string> GetSupportedExtensions()
The supported file extensions.
Imports a workbook from a stream with an optional timeout using a provider from the specified collection that supports the file extension.
public static Workbook Import(string extension, Stream input, IEnumerable<IWorkbookFormatProvider> formatProviders, TimeSpan? timeout)
The file extension.
inputStreamThe input stream.
formatProvidersIEnumerable<IWorkbookFormatProvider>The format providers to be used.
timeoutTimeSpan?The timeout after which the operation will be cancelled.
Returns:The workbook.
Exceptions:UnsupportedFileFormatException
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.
Imports a workbook from a stream with an optional timeout using the format provider registered for the specified file extension.
public static Workbook Import(string extension, Stream input, TimeSpan? timeout)
The file extension.
inputStreamThe input stream.
timeoutTimeSpan?The timeout after which the operation will be cancelled.
Returns:The 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.
Registers a format provider with the global manager, replacing any existing provider with the same name.
public static void RegisterFormatProvider(IWorkbookFormatProvider provider)
The provider.
Removes the specified format provider from the global manager's registry.
public static void UnregisterFormatProvider(IWorkbookFormatProvider provider)
The provider.
Properties
Gets the collection of all format providers registered with the application-wide manager.
public static IEnumerable<IWorkbookFormatProvider> FormatProviders { get; }
The format providers.