Text To Flowed Class
A text to flowed text converter.
Definition
Namespace: MimeKit.Text
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public class TextToFlowed : TextConverter- Inheritance
- Object TextConverter TextToFlowed
Remarks
Wraps text to conform with the flowed text format described in rfc3676.
The Content-Type header for the wrapped output text should be set to text/plain; format=flowed; delsp=yes.
Example
C#
public static TextPart CreateFlowedTextPart (string text)
{
// Convert normal text into format=flowed text which wraps long lines using soft line
// breaks that receiving clients will re-join.
var converter = new TextToFlowed ();
var part = new TextPart (TextFormat.Flowed) {
Text = converter.Convert (text)
};
// TextToFlowed output requires the "delsp=yes" parameter so that receiving clients
// remove the space that precedes each soft line break when re-joining the lines.
part.ContentType.Parameters.Add ("delsp", "yes");
// TextFormat.Flowed creates a text/plain part with the "format=flowed" parameter.
Console.WriteLine (part.ContentType); // Content-Type: text/plain; format="flowed"; charset="utf-8"; delsp="yes"
return part;
}
Constructors
| TextToFlowed | Initialize a new instance of the TextToFlowed class. |
Properties
| DetectEncodingFromByteOrderMark |
Get or set whether the encoding of the input is detected from the byte order mark or
determined by the InputEncoding property.
(Inherited from TextConverter) |
| Footer |
Get or set the text that will be appended to the end of the output.
(Inherited from TextConverter) |
| Header |
Get or set text that will be prepended to the beginning of the output.
(Inherited from TextConverter) |
| InputEncoding |
Get or set the input encoding.
(Inherited from TextConverter) |
| InputFormat |
Get the input format.
(Overrides TextConverterInputFormat) |
| InputStreamBufferSize |
Get or set the size of the input stream buffer.
(Inherited from TextConverter) |
| OutputEncoding |
Get or set the output encoding.
(Inherited from TextConverter) |
| OutputFormat |
Get the output format.
(Overrides TextConverterOutputFormat) |
| OutputStreamBufferSize |
Get or set the size of the output stream buffer.
(Inherited from TextConverter) |
Methods
| Convert(String) |
Convert text from the InputFormat to the OutputFormat.
(Inherited from TextConverter) |
| Convert(Stream, Stream) |
Convert the contents of source from the InputFormat to the
OutputFormat and writes the resulting text to destination.
(Inherited from TextConverter) |
| Convert(Stream, TextWriter) |
Convert the contents of source from the InputFormat to the
OutputFormat and uses the writer to write the resulting text.
(Inherited from TextConverter) |
| Convert(TextReader, Stream) |
Convert the contents of reader from the InputFormat to the
OutputFormat and writes the resulting text to destination.
(Inherited from TextConverter) |
| Convert(TextReader, TextWriter) |
Convert the contents of reader from the InputFormat to the
OutputFormat and uses the writer to write the resulting text.
(Overrides TextConverterConvert(TextReader, TextWriter)) |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
| GetHashCode | Serves as the default hash function. (Inherited from Object) |
| GetType | Gets the Type of the current instance. (Inherited from Object) |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) |
| ToString | Returns a string that represents the current object. (Inherited from Object) |