MediaType Struct
Represents formatted MIME media type value.
Constructors
MediaType(String)
Initializes a new instance of the MediaType structure with raw value.
Parameters
value
- String
The raw value.
Exceptions
Value is null or empty.
Input string is in invalid format.
MediaType(String, String)
Initializes a new instance of the MediaType structure with specified top level type and subtype.
public MediaType(string topLevelType, string subtype)
Public Sub New(topLevelType As String, subtype As String)
Parameters
topLevelType
- String
The top level type.
subtype
- String
The subtype.
Properties
Subtype
Gets the subtype.
Property Value
The subtype.
TopLevelType
Gets the top level type.
Property Value
The top level type.
Methods
Equals(Object)
Determines whether the specified Object, is equal to this instance.
public override bool Equals(object obj)
Public Overrides Function Equals(obj As Object) As Boolean
Parameters
Returns
Overrides
GetHashCode()
Returns a hash code for this instance.
Returns
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Overrides
ToString()
Returns a String that represents this instance.
Returns
Overrides
Operators
Equality(MediaType, MediaType)
Implements the operator ==.
public static bool operator ==(MediaType item1, MediaType item2)
Public Shared Operator =(item1 As MediaType, item2 As MediaType) As Boolean
Parameters
item1
- MediaType
The item1.
item2
- MediaType
The item2.
Returns
The result of the operator.
Implicit(MediaType to String)
public static implicit operator string (MediaType value)
Public Shared Widening Operator CType(value As MediaType) As String
Parameters
value
- MediaType
The value.
Returns
The result of the conversion.
Implicit(String to MediaType)
public static implicit operator MediaType(string value)
Public Shared Widening Operator CType(value As String) As MediaType
Parameters
value
- String
The value.
Returns
The result of the conversion.
Inequality(MediaType, MediaType)
Implements the operator !=.
public static bool operator !=(MediaType item1, MediaType item2)
Public Shared Operator <>(item1 As MediaType, item2 As MediaType) As Boolean
Parameters
item1
- MediaType
The item1.
item2
- MediaType
The item2.
Returns
The result of the operator.