PeterO.Mail.DispositionBuilder
PeterO.Mail.DispositionBuilder
public class DispositionBuilder
Deprecated. Use ContentDisposition.Builder instead.
A mutable data type that allows a content disposition to be built.
Member Summary
DispositionType
- Gets or sets this value's disposition type, such as "inline" or "attachment".IsMultipart
- Deprecated: Irrelevant for content dispositions; will be removed in the future.IsText
- Deprecated: Irrelevant for content dispositions; will be removed in the future.RemoveParameter(string)
- Removes a parameter from this content disposition.SetDispositionType(string)
- Sets the disposition type, such as "inline".SetParameter(string, string)
- Sets a parameter of this content disposition.ToDisposition()
- Converts this object to an immutable ContentDisposition object.ToString()
- Converts this object to a text string.
DispositionBuilder Constructor
public DispositionBuilder( PeterO.Mail.ContentDisposition mt);
Initializes a new instance of the PeterO.Mail.DispositionBuilder class using the data from the given content disposition.
Parameters:
- mt: The parameter mt is a ContentDisposition object.
Exceptions:
- System.ArgumentNullException: The parameter mt is null.
DispositionBuilder Constructor
public DispositionBuilder( string type);
Initializes a new instance of the PeterO.Mail.DispositionBuilder class using the given disposition type.
Parameters:
- type: The parameter type is a text string.
Exceptions:
System.ArgumentNullException: The parameter type is null.
System.ArgumentException: Type is empty.
DispositionBuilder Constructor
public DispositionBuilder();
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:
System.ArgumentNullException: The property is being set and the value is null.
System.ArgumentException: The property is being set and the value is an empty string.
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.DispositionBuilder RemoveParameter( string name);
Removes a parameter from this content disposition. Does nothing if the parameter's name doesn't exist.
Parameters:
- name: The parameter to remove. The name is compared using a basic case-insensitive comparison. (Two strings are equal in such a comparison, if they match after converting the basic upper-case letters A to Z (U+0041 to U+005A) in both strings to basic lower-case letters.).
Return Value:
This instance.
Exceptions:
- System.ArgumentNullException: The parameter name is null.
SetDispositionType
public PeterO.Mail.DispositionBuilder 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:
- str: The parameter str is a text string.
Return Value:
This instance.
Exceptions:
System.ArgumentNullException: The parameter str is null.
System.ArgumentException: Str is empty.
SetParameter
public PeterO.Mail.DispositionBuilder SetParameter( string name, string value);
Sets a parameter of this content disposition.
Parameters:
name: Name of the parameter to set. If this name already exists (compared using a basic case-insensitive comparison), it will be overwritten. (Two strings are equal in a basic case-insensitive comparison, if they match after converting the basic upper-case letters A to Z (U+0041 to U+005A) in both strings to basic lower-case letters.).
value: Value of the parameter to set.
Return Value:
This instance.
Exceptions:
System.ArgumentNullException: Either value or name is null.
System.ArgumentException: The parameter name is empty, or it isn't a well-formed parameter name.
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.