Class
FormatProviderBase<T>

Base for format providers that import/export documents via streams, exposing capability flags and supported extensions.

Definition

Namespace:Telerik.Windows.Documents.Common.FormatProviders

Assembly:Telerik.Windows.Documents.Core.dll

Type Parameters:

T

Syntax:

cs-api-definition
public abstract class FormatProviderBase<T> : IFormatProvider<T>

Inheritance: objectFormatProviderBase<T>

Derived Classes: BinaryFormatProviderBase<T>TextBasedFormatProviderBase<T>

Implements: IFormatProvider<T>

Constructors

FormatProviderBase()

Declaration

cs-api-definition
protected FormatProviderBase()

Properties

CanExport

Gets a value indicating whether this provider supports export.

Declaration

cs-api-definition
public abstract bool CanExport { get; }

Property Value

bool

The value indicating whether can export.

Implements IFormatProvider<T>.CanExport

CanImport

Gets a value indicating whether this provider supports import.

Declaration

cs-api-definition
public abstract bool CanImport { get; }

Property Value

bool

The value indicating whether can import.

Implements IFormatProvider<T>.CanImport

SupportedExtensions

Gets the file extensions supported by this provider.

Declaration

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

Property Value

IEnumerable<string>

The supported extensions.

Implements IFormatProvider<T>.SupportedExtensions

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.")]
public void Export(T document, Stream output)

Parameters

document

T

The document.

output

Stream

The output stream.

Implements IFormatProvider<T>.Export(T, Stream)

Export(T, Stream, TimeSpan?)

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

Declaration

cs-api-definition
public 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.

Implements IFormatProvider<T>.Export(T, Stream, TimeSpan?)

ExportOverride(T, Stream)

Exports the specified document.

Declaration

cs-api-definition
[Obsolete("This method is obsolete. Please use ExportOverride(T document, Stream output, CancellationToken cancellationToken) instead.")]
protected virtual void ExportOverride(T document, Stream output)

Parameters

document

T

The document.

output

Stream

The output.

ExportOverride(T, Stream, CancellationToken)

Exports the specified document.

Declaration

cs-api-definition
protected virtual void ExportOverride(T document, Stream output, CancellationToken cancellationToken)

Parameters

document

T

The document.

output

Stream

The output.

cancellationToken

CancellationToken

The cancellation token used to cancel the operation.

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.")]
public T Import(Stream input)

Parameters

input

Stream

The input stream.

Returns

T

The imported document.

Implements IFormatProvider<T>.Import(Stream)

Import(Stream, TimeSpan?)

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

Declaration

cs-api-definition
public 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.

Implements IFormatProvider<T>.Import(Stream, TimeSpan?)

ImportOverride(Stream)

Imports the specified input.

Declaration

cs-api-definition
[Obsolete("This method is obsolete. Please use ImportOverride(Stream input, CancellationToken cancellationToken) instead.")]
protected virtual T ImportOverride(Stream input)

Parameters

input

Stream

The input.

Returns

T

The imported document.

ImportOverride(Stream, CancellationToken)

Imports the specified input.

Declaration

cs-api-definition
protected virtual T ImportOverride(Stream input, CancellationToken cancellationToken)

Parameters

input

Stream

The input.

cancellationToken

CancellationToken

The cancellation token used to cancel the operation.

Returns

T

The imported document.