다음을 통해 공유


TextConverters Architecture

Topic Last Modified: 2007-11-05

The Microsoft.Exchange.Data.TextConverters namespace contains types that support the conversion of the contents of e-mail messages. These types can perform code page conversion, remove HTML that is not secure, and perform other transformations on e-mail message bodies. The Microsoft.Exchange.Data.TextConverters namespace includes the following three categories of types:

  • Conversions
  • Converters
  • Various supporting classes, structures, and enumerations

Conversions

Conversions enable you to change the format of a document stream or to remove elements that are not secure from an HTML document. Conversions, derived from the TextConverter class, each encapsulate a specific transformation. For example, the RtfToHtml class transforms an input HTML stream into Rich Text Format (RTF). Conversions can be used by themselves to perform a conversion by using a single call to one of the Convert methods in the TextConverter class, or they can be passed to a constructor of the converter, which uses it to perform converted reads or writes.

The TextConverter class is useful for performing conversions when you have sufficient space to store the original document and its converted output, or when you want to store the results of the conversion. The base TextConverter class has a Convert method, which takes input and output streams, text readers, or text writers, and transforms the contents of one and outputs it to the other. This method converts all the input to the output.

Converters

The Microsoft.Exchange.Data.TextConverters namespace includes the following three converter classes:

These classes enable you to run a specific conversion on a stream. You can use a converter to perform any conversion incrementally by passing a TextConverter to the constructor of the converter. The converter will use this conversion to transform content during reads or writes.

Converters are useful for performing conversions when you do not have room to store the original or its converted output, when you receive the input from or send the output to a stream, or when you want the output only for indexing or search purposes and therefore do not want to store the result of the conversion.