• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class ContentType

Represents the value of a Content-Type header field (RFC 2045 §5).

Inheritance
object
ContentType
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Mail.Rfc.Mime
Assembly: DRIT.Mail.dll
Syntax
public sealed class ContentType

Constructors

View Source

ContentType(string, string, MimeHeaderParameterCollection)

Initializes a new instance of the ContentType class.

Declaration
public ContentType(string mediaType, string mediaSubtype, MimeHeaderParameterCollection parameters)
Parameters
Type Name Description
string mediaType

The media type used by the operation.

string mediaSubtype

The media subtype used by the operation.

MimeHeaderParameterCollection parameters

Specifies the parameters value.

Properties

View Source

Boundary

Gets the boundary parameter value (for multipart entities), or null if not specified.

Declaration
public string? Boundary { get; }
Property Value
Type Description
string
View Source

Charset

Gets the charset parameter value, or null if not specified.

Declaration
public string? Charset { get; }
Property Value
Type Description
string
View Source

IsAttachment

Gets a value indicating whether this content type has a name parameter (suggesting an attachment).

Declaration
public bool IsAttachment { get; }
Property Value
Type Description
bool
View Source

IsMultipart

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

Declaration
public bool IsMultipart { get; }
Property Value
Type Description
bool
View Source

IsText

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

Declaration
public bool IsText { get; }
Property Value
Type Description
bool
View Source

MediaSubtype

Gets the media subtype (e.g. plain, html, mixed).

Declaration
public string MediaSubtype { get; }
Property Value
Type Description
string
View Source

MediaType

Gets the top-level media type (e.g. text, multipart, application).

Declaration
public string MediaType { get; }
Property Value
Type Description
string
View Source

MimeType

Gets the full MIME type string (e.g. text/plain).

Declaration
public string MimeType { get; }
Property Value
Type Description
string
View Source

Name

Gets the name parameter value (typically a filename), or null if not specified.

Declaration
public string? Name { get; }
Property Value
Type Description
string
View Source

Parameters

Gets the parameters associated with this Content-Type.

Declaration
public MimeHeaderParameterCollection Parameters { get; }
Property Value
Type Description
MimeHeaderParameterCollection

Methods

View Source

Parse(string)

Parses a Content-Type header value (e.g. text/plain; charset=utf-8).

Declaration
public static ContentType Parse(string value)
Parameters
Type Name Description
string value

The value to process.

Returns
Type Description
ContentType
View Source

ToString()

Processes the to string data.

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()
  • View Source
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX