Show / Hide Table of Contents

Class MimeTypeSelector

Selector used in selecting which MIME type to use.

Inheritance
object
MimeTypeSelector
Implements
IComparable<MimeTypeSelector>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public sealed class MimeTypeSelector : IComparable<MimeTypeSelector>

Constructors

| Edit this page View Source

MimeTypeSelector(string, string, double, int)

Creates a new MIME Type Selector.

Declaration
public MimeTypeSelector(string type, string charset, double quality, int order)
Parameters
Type Name Description
string type

MIME Type to match.

string charset

Charset.

double quality

Quality (in range 0.0-1.0).

int order

Order of appearance (used as precendence tiebreaker where necessary).

Properties

| Edit this page View Source

Charset

Gets the Charset for the selector (may be null if none specified).

Declaration
public string Charset { get; }
Property Value
Type Description
string
| Edit this page View Source

IsAny

Gets whether the selector if for a / pattern i.e. accept any.

Declaration
public bool IsAny { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsInvalid

Gets whether the selector is invalid.

Declaration
public bool IsInvalid { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsRange

Gets whether the selector is for a type/* pattern i.e. accept any sub-type of the given type.

Declaration
public bool IsRange { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsSpecific

Gets whether the selector is for a specific MIME type e.g. type/sub-type.

Declaration
public bool IsSpecific { get; }
Property Value
Type Description
bool
| Edit this page View Source

Order

Gets the order of apperance for the selector (used as precedence tiebreaker where necessary).

Declaration
public int Order { get; }
Property Value
Type Description
int
| Edit this page View Source

Quality

Gets the quality for the selector (range of 0.0-1.0).

Declaration
public double Quality { get; }
Property Value
Type Description
double
| Edit this page View Source

RangeType

Gets the range type if this is a range selector.

Declaration
public string RangeType { get; }
Property Value
Type Description
string

A type string of the form type/ if this is a range selector, otherwise null.

| Edit this page View Source

Type

Gets the selected type.

Declaration
public string Type { get; }
Property Value
Type Description
string

A type string of the form type/subtype assuming the type if valid.

Methods

| Edit this page View Source

CompareTo(MimeTypeSelector)

Sorts the selector in precedence order according to the content negotiation rules from the relevant RFCs.

Declaration
public int CompareTo(MimeTypeSelector other)
Parameters
Type Name Description
MimeTypeSelector other

Selector to compare against.

Returns
Type Description
int
| Edit this page View Source

Create(string, int)

Creates a MIME Type selector.

Declaration
public static MimeTypeSelector Create(string contentType, int order)
Parameters
Type Name Description
string contentType

MIME Type.

int order

Order the selector appears in the input.

Returns
Type Description
MimeTypeSelector
| Edit this page View Source

CreateSelectors(IEnumerable<string>)

Creates an enumeration of MIME type selectors.

Declaration
public static IEnumerable<MimeTypeSelector> CreateSelectors(IEnumerable<string> ctypes)
Parameters
Type Name Description
IEnumerable<string> ctypes

MIME Types.

Returns
Type Description
IEnumerable<MimeTypeSelector>
| Edit this page View Source

ToString()

Gets the string representation of the selector as it would appear in an Accept header.

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()
Remarks

Unless this is an invalid selector this will always be a valid selector that could be appended to a MIME type header.

Implements

IComparable<T>

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • MimeTypeSelector(string, string, double, int)
  • Properties
    • Charset
    • IsAny
    • IsInvalid
    • IsRange
    • IsSpecific
    • Order
    • Quality
    • RangeType
    • Type
  • Methods
    • CompareTo(MimeTypeSelector)
    • Create(string, int)
    • CreateSelectors(IEnumerable<string>)
    • ToString()
  • Implements
  • Extension Methods
Back to top Generated by DocFX