TnefOptions Class

Options that control how a TNEF stream is read.

Definition

Namespace: MimeKit.Tnef
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public class TnefOptions
Inheritance
Object    TnefOptions

Remarks

Options that control how a TNEF stream is read.

The options are consulted while the stream is being read, so they should not be modified while a TnefReader that uses them is in use.

Example

C#
                    public static TnefMessage LoadUntrusted (TnefPart part)
{
    // TnefMessage buffers the bodies and attachments in memory, so set limits that are appropriate
    // for the application when the TNEF comes from an untrusted source.
    var options = new TnefOptions {
        // The codepage to use when the TNEF stream does not specify one.
        DefaultCodepage = 1252,
        MaxNestingDepth = 8,
        MaxAttachments = 256,
        MaxPropertyValueLength = 16 * 1024 * 1024,
        MaxTotalDataBytes = 64L * 1024 * 1024
    };

    return part.LoadTnefMessage (options);
}
                  

Constructors

TnefOptions Initialize a new instance of the TnefOptions class.

Properties

DefaultCodepage Get or set the codepage to use for 8-bit strings when the stream does not specify one.
MaxAttachments Get or set the maximum number of attachments that will be loaded for a single message.
MaxNestingDepth Get or set the maximum nesting depth of embedded messages.
MaxPropertyValueLength Get or set the maximum length of a single value that will be read into memory.
MaxTotalDataBytes Get or set the maximum number of bytes of value data that will be read into memory.

Methods

Clone Clone an instance of TnefOptions.
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)

Fields

Default The default TNEF options.
DefaultMaxAttachments The default maximum number of attachments that will be loaded for a single message.
DefaultMaxNestingDepth The default maximum nesting depth of embedded messages.
DefaultMaxPropertyValueLength The default maximum length of a single value that will be read into memory.
DefaultMaxTotalDataBytes The default maximum number of bytes of value data that will be read into memory.

See Also