New to Telerik Document ProcessingStart a free 30-day trial

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:

C#
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.

C#
public static void Export(Workbook workbook, string extension, Stream output, IEnumerable<IWorkbookFormatProvider> formatProviders, TimeSpan? timeout)
Parameters:workbookWorkbook

The workbook.

extensionstring

The file extension.

outputStream

The output stream.

formatProvidersIEnumerable<IWorkbookFormatProvider>

The format providers to be used.

timeoutTimeSpan?

The timeout after which the operation will be cancelled.

Exceptions:

UnsupportedFileFormatException

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.

Exports a workbook to a stream with an optional timeout using the format provider registered for the specified file extension.

C#
public static void Export(Workbook workbook, string extension, Stream output, TimeSpan? timeout)
Parameters:workbookWorkbook

The workbook.

extensionstring

The file extension.

outputStream

The output stream.

timeoutTimeSpan?

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.

Retrieves the format provider that supports the specified file extension from the registered providers, or null if not found.

C#
public static IWorkbookFormatProvider GetProviderByExtension(string extension)
Parameters:extensionstring

The extension.

Returns:

IWorkbookFormatProvider

The format provider.

Retrieves the format provider with the specified name from the registered providers, or null if not found.

C#
public static IWorkbookFormatProvider GetProviderByName(string providerName)
Parameters:providerNamestring

Name of the provider.

Returns:

IWorkbookFormatProvider

The format provider.

Enumerates all unique file extensions supported by registered format providers for import or export.

C#
public static IEnumerable<string> GetSupportedExtensions()
Returns:

IEnumerable<string>

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.

C#
public static Workbook Import(string extension, Stream input, IEnumerable<IWorkbookFormatProvider> formatProviders, TimeSpan? timeout)
Parameters:extensionstring

The file extension.

inputStream

The input stream.

formatProvidersIEnumerable<IWorkbookFormatProvider>

The format providers to be used.

timeoutTimeSpan?

The timeout after which the operation will be cancelled.

Returns:

Workbook

The workbook.

Exceptions:

UnsupportedFileFormatException

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.

Imports a workbook from a stream with an optional timeout using the format provider registered for the specified file extension.

C#
public static Workbook Import(string extension, Stream input, TimeSpan? timeout)
Parameters:extensionstring

The file extension.

inputStream

The input stream.

timeoutTimeSpan?

The timeout after which the operation will be cancelled.

Returns:

Workbook

The 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.

Registers a format provider with the global manager, replacing any existing provider with the same name.

C#
public static void RegisterFormatProvider(IWorkbookFormatProvider provider)
Parameters:providerIWorkbookFormatProvider

The provider.

Removes the specified format provider from the global manager's registry.

C#
public static void UnregisterFormatProvider(IWorkbookFormatProvider provider)
Parameters:providerIWorkbookFormatProvider

The provider.

Properties

Gets the collection of all format providers registered with the application-wide manager.

C#
public static IEnumerable<IWorkbookFormatProvider> FormatProviders { get; }
Property Value:

The format providers.