MediaType Struct
Represents formatted MIME media type value.
public struct MediaType : IEquatable<MediaType>
Public Structure MediaType
Implements IEquatable(Of MediaType)
Implements
Constructors
MediaType(String)
Initializes a new instance of the MediaType structure with raw value.
Parameters
value
- System.String
The raw value.
Exceptions
- System.ArgumentException
Value is null or empty.
- System.ArgumentException
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
- System.String
The top level type.
subtype
- System.String
The subtype.
Properties
Subtype
Gets the subtype.
Property Value
- System.String
The subtype.
TopLevelType
Gets the top level type.
Property Value
- System.String
The top level type.
Methods
Equals(MediaType)
Parameters
other
- MediaType
The other media type to compare with this media type instance.
Returns
Equals(Object)
Determines whether the specified System.Object, is equal to this instance.
public override bool Equals(object obj)
Public Overrides Function Equals(obj As Object) As Boolean
Parameters
obj
- System.Object
The System.Object to compare with this instance.
Returns
- System.Boolean
true
if the specified System.Object is equal to this instance; otherwise, false
.
Overrides
GetHashCode()
Returns a hash code for this instance.
Returns
- System.Int32
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Overrides
ToString()
Returns a System.String that represents this instance.
Returns
- System.String
A System.String that represents this instance.
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
- System.Boolean
The result of the operator.
Implicit(MediaType to String)
Performs an implicit conversion from MediaType to System.String.
public static implicit operator string (MediaType value)
Public Shared Widening Operator CType(value As MediaType) As String
Parameters
value
- MediaType
The value.
Returns
- System.String
The result of the conversion.
Implicit(String to MediaType)
Performs an implicit conversion from System.String to MediaType.
public static implicit operator MediaType(string value)
Public Shared Widening Operator CType(value As String) As MediaType
Parameters
value
- System.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
- System.Boolean
The result of the operator.