New to Telerik Document ProcessingStart a free 30-day trial

Contract for text-based format providers that import/export documents from/to strings.

Definition

Namespace:Telerik.Windows.Documents.Common.FormatProviders

Assembly:Telerik.Windows.Documents.Core.dll

Type Parameters:

T

Syntax:

C#
public interface ITextBasedFormatProvider<T>

Derived Classes: TextBasedFormatProviderBase<T>HtmlFormatProviderMarkdownFormatProviderRtfFormatProviderTxtFormatProvider

Methods

Exports the document to a text string with an optional timeout.

C#
string Export(T document, TimeSpan? timeout)
Parameters:documentT

The document.

timeoutTimeSpan?

The timeout after which the operation will be cancelled.

Returns:

string

The result string.

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.

Imports a document from a text string with an optional timeout and returns the parsed document.

C#
T Import(string input, TimeSpan? timeout)
Parameters:inputstring

The input.

timeoutTimeSpan?

The timeout after which the operation will be cancelled.

Returns:

T

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