Interface
IFormatProvider<T>

Contract for format providers that import/export documents via streams and expose capabilities and extensions.

Definition

Namespace:Telerik.Windows.Documents.Common.FormatProviders

Assembly:Telerik.Windows.Documents.Core.dll

Type Parameters:

T

Syntax:

cs-api-definition
public interface IFormatProvider<T>

Derived Classes: BinaryFormatProviderBase<T>FormatProviderBase<T>TextBasedFormatProviderBase<T>OcrFormatProviderPdfFormatProviderDocFormatProviderDocxFormatProviderHtmlFormatProviderPdfFormatProviderRtfFormatProviderTxtFormatProvider

Properties

CanExport

Gets a value indicating whether this provider supports export.

Declaration

cs-api-definition
bool CanExport { get; }

Property Value

bool

The value indicating whether can export.

CanImport

Gets a value indicating whether this provider supports import.

Declaration

cs-api-definition
bool CanImport { get; }

Property Value

bool

The value indicating whether can import.

SupportedExtensions

Gets the file extensions supported by this provider.

Declaration

cs-api-definition
IEnumerable<string> SupportedExtensions { get; }

Property Value

IEnumerable<string>

The supported extensions.

Methods

Export(T, Stream)

Exports the document to the output stream.

Declaration

cs-api-definition
[Obsolete("This method is obsolete. Please use Export(T document, Stream output, TimeSpan? timeout) instead.")]
void Export(T document, Stream output)

Parameters

document

T

The document.

output

Stream

The output stream.

Export(T, Stream, TimeSpan?)

Exports the document to the output stream with an optional timeout.

Declaration

cs-api-definition
void Export(T document, Stream output, TimeSpan? timeout)

Parameters

document

T

The document.

output

Stream

The output stream.

timeout

TimeSpan?

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.

Import(Stream)

Imports a document from the input stream and returns the parsed document.

Declaration

cs-api-definition
[Obsolete("This method is obsolete. Please use Import(Stream input, TimeSpan? timeout) instead.")]
T Import(Stream input)

Parameters

input

Stream

The input stream.

Returns

T

The imported document.

Import(Stream, TimeSpan?)

Imports a document from the input stream with an optional timeout and returns the parsed document.

Declaration

cs-api-definition
T Import(Stream input, TimeSpan? timeout)

Parameters

input

Stream

The input stream.

timeout

TimeSpan?

The timeout after which the operation will be cancelled.

Returns

T

The imported document.

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.