PeterO.Mail.ContentDisposition.Builder

## PeterO.Mail.ContentDisposition.Builder

public sealed class Builder

A mutable data type that allows a content disposition to be built.

Member Summary

### Builder Constructor

public Builder(
    PeterO.Mail.ContentDisposition mt);

Initializes a new instance of the PeterO.Mail.DispositionBuilder class using the data from the given content disposition.

Parameters:

Exceptions:

### Builder Constructor

public Builder(
    string type);

Initializes a new instance of the PeterO.Mail.ContentDisposition.Builder class using the given disposition type.

Parameters:

Exceptions:

### Builder Constructor

public Builder();

Initializes a new instance of the PeterO.Mail.DispositionBuilder class using the disposition type “attachment” .

### DispositionType

public string DispositionType { get; set; }

Gets or sets this value’s disposition type, such as “inline” or “attachment”.

Returns:

This value’s disposition type, such as “inline” or “attachment” .

Exceptions:

### IsMultipart

public bool IsMultipart { get; }

Deprecated. Irrelevant for content dispositions; will be removed in the future.

Gets a value indicating whether this is a multipart media type.

Returns:

true If this is a multipart media type; otherwise, false .

### IsText

public bool IsText { get; }

Deprecated. Irrelevant for content dispositions; will be removed in the future.

Gets a value indicating whether this is a text media type.

Returns:

true If this is a text media type; otherwise, false .

### RemoveParameter

public PeterO.Mail.ContentDisposition.Builder RemoveParameter(
    string name);

Removes a parameter from this content disposition. Does nothing if the parameter’s name doesn’t exist.

Parameters:

Return Value:

This instance.

Exceptions:

### SetDispositionType

public PeterO.Mail.ContentDisposition.Builder SetDispositionType(
    string str);

Sets the disposition type, such as “inline”. This method enables the pattern of method chaining (e.g., new ...().Set...().Set...() ) unlike with the DispositionType property in .NET or the setDispositionType method (with small s) in Java.

Parameters:

Return Value:

This instance.

Exceptions:

### SetParameter

public PeterO.Mail.ContentDisposition.Builder SetParameter(
    string name,
    string value);

Sets a parameter of this content disposition.

Parameters:

Return Value:

This instance.

Exceptions:

### ToDisposition

public PeterO.Mail.ContentDisposition ToDisposition();

Converts this object to an immutable ContentDisposition object.

Return Value:

A MediaType object.

### ToString

public override string ToString();

Converts this object to a text string.

Return Value:

A string representation of this object.

Back to MailLib start page.