Table of Contents

Class MimeType

Namespace
AngleSharp.Io
Assembly
AngleSharp.dll

Represents an Internet media type.

public class MimeType : IEquatable<MimeType>
Inheritance
MimeType
Implements
Inherited Members
Extension Methods

Constructors

MimeType(string)

Creates a new MIME type.

public MimeType(string value)

Parameters

value string

The serialized value.

Properties

Content

Gets the content part, i.e. everything without the parameters.

public string Content { get; }

Property Value

string

GeneralType

Gets the general type.

public string GeneralType { get; }

Property Value

string

Keys

Gets an iterator over all integrated keys.

public IEnumerable<string> Keys { get; }

Property Value

IEnumerable<string>

MediaType

Gets the media type, if specified.

public string MediaType { get; }

Property Value

string

Suffix

Gets the suffix, if any.

public string Suffix { get; }

Property Value

string

Methods

Equals(MimeType?)

Compares the MIME types without considering their parameters.

public bool Equals(MimeType? other)

Parameters

other MimeType

The type to compare to.

Returns

bool

True if both types are equal, otherwise false.

Equals(object?)

Compares to the other object. It has to be a MIME type.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare to.

Returns

bool

True if both objects are equal, otherwise false.

GetHashCode()

Computes the hash code for the MIME type.

public override int GetHashCode()

Returns

int

The computed hash code.

GetParameter(string)

Returns the value of the parameter with the specified key.

public string? GetParameter(string key)

Parameters

key string

The parameter's key.

Returns

string

The value of the parameter or null.

ToString()

Returns the string representation of the MIME type.

public override string ToString()

Returns

string

The currently stored MIME type.

Operators

operator ==(MimeType, MimeType)

Runs the Equals method from a with b.

public static bool operator ==(MimeType a, MimeType b)

Parameters

a MimeType

The first MIME type.

b MimeType

The MIME type to compare to.

Returns

bool

True if both are equal, otherwise false.

operator !=(MimeType, MimeType)

Runs the negated Equals method from a with b.

public static bool operator !=(MimeType a, MimeType b)

Parameters

a MimeType

The first MIME type.

b MimeType

The MIME type to compare to.

Returns

bool

True if both are not equal, otherwise false.