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
stringThe serialized value.
Properties
Content
Gets the content part, i.e. everything without the parameters.
public string Content { get; }
Property Value
GeneralType
Gets the general type.
public string GeneralType { get; }
Property Value
Keys
Gets an iterator over all integrated keys.
public IEnumerable<string> Keys { get; }
Property Value
MediaType
Gets the media type, if specified.
public string MediaType { get; }
Property Value
Suffix
Gets the suffix, if any.
public string Suffix { get; }
Property Value
Methods
Equals(MimeType?)
Compares the MIME types without considering their parameters.
public bool Equals(MimeType? other)
Parameters
other
MimeTypeThe 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
objectThe 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
stringThe 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
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
Returns
- bool
True if both are not equal, otherwise false.