ClassFormatProviderBase<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:
public abstract class FormatProviderBase<T> : IFormatProvider<T>
Inheritance: objectFormatProviderBase<T>
Derived Classes:
Implements:
Constructors
FormatProviderBase()
Declaration
protected FormatProviderBase()
Properties
CanExport
Gets a value indicating whether this provider supports export.
Declaration
public abstract bool CanExport { get; }
Property Value
The value indicating whether can export.
Implements
CanImport
Gets a value indicating whether this provider supports import.
Declaration
public abstract bool CanImport { get; }
Property Value
The value indicating whether can import.
Implements
SupportedExtensions
Gets the file extensions supported by this provider.
Declaration
public abstract IEnumerable<string> SupportedExtensions { get; }
Property Value
The supported extensions.
Implements
Methods
Export(T, Stream)
Exports the document to the output stream.
Declaration
[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
The output stream.
Implements
Export(T, Stream, TimeSpan?)
Exports the document to the output stream with an optional timeout.
Declaration
public void Export(T document, Stream output, TimeSpan? timeout)
Parameters
document
T
The document.
output
The output stream.
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.
Implements
ExportOverride(T, Stream)
Exports the specified document.
Declaration
[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
The output.
ExportOverride(T, Stream, CancellationToken)
Exports the specified document.
Declaration
protected virtual void ExportOverride(T document, Stream output, CancellationToken cancellationToken)
Parameters
document
T
The document.
output
The output.
cancellationToken
The cancellation token used to cancel the operation.
Import(Stream)
Imports a document from the input stream and returns the parsed document.
Declaration
[Obsolete("This method is obsolete. Please use Import(Stream input, TimeSpan? timeout) instead.")]
public T Import(Stream input)
Parameters
input
The input stream.
Returns
T
The imported document.
Implements
Import(Stream, TimeSpan?)
Imports a document from the input stream with an optional timeout and returns the parsed document.
Declaration
public T Import(Stream input, TimeSpan? timeout)
Parameters
input
The input stream.
timeout
The timeout after which the operation will be cancelled.
Returns
T
The imported document.
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.
Implements
ImportOverride(Stream)
Imports the specified input.
Declaration
[Obsolete("This method is obsolete. Please use ImportOverride(Stream input, CancellationToken cancellationToken) instead.")]
protected virtual T ImportOverride(Stream input)
Parameters
input
The input.
Returns
T
The imported document.
ImportOverride(Stream, CancellationToken)
Imports the specified input.
Declaration
protected virtual T ImportOverride(Stream input, CancellationToken cancellationToken)
Parameters
input
The input.
cancellationToken
The cancellation token used to cancel the operation.
Returns
T
The imported document.