Unosquare
    Show / Hide Table of Contents

    Class MimeTypeCustomizerExtensions

    Provides extension methods for types implementing IMimeTypeCustomizer.

    Inheritance
    Object
    MimeTypeCustomizerExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: EmbedIO
    Syntax
    public static class MimeTypeCustomizerExtensions

    Methods

    PreferCompressionFor<T>(T, String)

    Indicates that compression should be preferred when negotiating content encoding for a response with the specified content type, or whose content type is in the specified media range.

    Declaration
    public static T PreferCompressionFor<T>(this T this, string mimeType)
        where T : IMimeTypeCustomizer
    Parameters
    Type Name Description
    T this

    The object to which this method is applied.

    String mimeType

    The MIME type or media range.

    Returns
    Type Description
    T

    this with the specified preference added.

    Type Parameters
    Name Description
    T

    The type of the object to which this method is applied.

    PreferCompressionFor<T>(T, String, Boolean)

    Indicates whether to prefer compression when negotiating content encoding for a response with the specified content type, or whose content type is in the specified media range.

    Declaration
    public static T PreferCompressionFor<T>(this T this, string mimeType, bool preferCompression)
        where T : IMimeTypeCustomizer
    Parameters
    Type Name Description
    T this

    The object to which this method is applied.

    String mimeType

    The MIME type or media range.

    Boolean preferCompression

    true to prefer compression; otherwise, false.

    Returns
    Type Description
    T

    this with the specified preference added.

    Type Parameters
    Name Description
    T

    The type of the object to which this method is applied.

    PreferNoCompressionFor<T>(T, String)

    Indicates that no compression should be preferred when negotiating content encoding for a response with the specified content type, or whose content type is in the specified media range.

    Declaration
    public static T PreferNoCompressionFor<T>(this T this, string mimeType)
        where T : IMimeTypeCustomizer
    Parameters
    Type Name Description
    T this

    The object to which this method is applied.

    String mimeType

    The MIME type or media range.

    Returns
    Type Description
    T

    this with the specified preference added.

    Type Parameters
    Name Description
    T

    The type of the object to which this method is applied.

    WithCustomMimeType<T>(T, String, String)

    Adds a custom association between a file extension and a MIME type.

    Declaration
    public static T WithCustomMimeType<T>(this T this, string extension, string mimeType)
        where T : IMimeTypeCustomizer
    Parameters
    Type Name Description
    T this

    The object to which this method is applied.

    String extension

    The file extension to associate to mimeType.

    String mimeType

    The MIME type to associate to extension.

    Returns
    Type Description
    T

    this with the custom association added.

    Type Parameters
    Name Description
    T

    The type of the object to which this method is applied.

    Comments

    Back to top Copyright © 2017-2019 Unosquare