Show / Hide Table of Contents

    Class UriUtility

    This utility class is designed to make System.Uri operations easier to work with.

    Inheritance
    System.Object
    UriUtility
    Namespace: Cuemon
    Assembly: Cuemon.Core.dll
    Syntax
    public static class UriUtility

    Properties

    | Improve this Doc

    AllUriSchemes

    Gets all URI schemes currently supported by the .NET framework.

    Declaration
    public static IEnumerable<UriScheme> AllUriSchemes { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<UriScheme>

    A sequence of all URI schemes currently supported by the .NET framework.

    Methods

    | Improve this Doc

    IsProtocolRelativeUri(String)

    Determines whether the specified value is a protocol-relative URI string.

    Declaration
    public static bool IsProtocolRelativeUri(string value)
    Parameters
    Type Name Description
    System.String value

    The string value representing the protocol-relative URI.

    Returns
    Type Description
    System.Boolean

    true if the specified value is a protocol-relative URI; otherwise, false.

    | Improve this Doc

    IsProtocolRelativeUri(String, String)

    Determines whether the specified value is a protocol-relative URI string.

    Declaration
    public static bool IsProtocolRelativeUri(string value, string relativeReference)
    Parameters
    Type Name Description
    System.String value

    The string value representing the protocol-relative URI.

    System.String relativeReference

    The relative reference that value must begin with. Default is NetworkPathReference.

    Returns
    Type Description
    System.Boolean

    true if the specified value is a protocol-relative URI; otherwise, false.

    | Improve this Doc

    IsUri(String)

    Determines whether the specified value is an absolute URI string from all known URI schemes.

    Declaration
    public static bool IsUri(string value)
    Parameters
    Type Name Description
    System.String value

    The string value representing the URI.

    Returns
    Type Description
    System.Boolean

    true if the specified value evaluates to an URI; otherwise, false.

    | Improve this Doc

    IsUri(String, IEnumerable<UriScheme>)

    Determines whether the specified value is an absolute URI string.

    Declaration
    public static bool IsUri(string value, IEnumerable<UriScheme> uriSchemes)
    Parameters
    Type Name Description
    System.String value

    The string value representing the URI.

    System.Collections.Generic.IEnumerable<UriScheme> uriSchemes

    A sequence of UriScheme values to use in the validation of the URI.

    Returns
    Type Description
    System.Boolean

    true if the specified value evaluates to an absolute URI; otherwise, false.

    | Improve this Doc

    IsUri(String, UriKind)

    Determines whether the specified value is an URI string from all known URI schemes.

    Declaration
    public static bool IsUri(string value, UriKind uriKind)
    Parameters
    Type Name Description
    System.String value

    The string value representing the URI.

    System.UriKind uriKind

    The type of the URI.

    Returns
    Type Description
    System.Boolean

    true if the specified value evaluates to an URI; otherwise, false.

    | Improve this Doc

    IsUri(String, UriKind, IEnumerable<UriScheme>)

    Determines whether the specified value is an URI string.

    Declaration
    public static bool IsUri(string value, UriKind uriKind, IEnumerable<UriScheme> uriSchemes)
    Parameters
    Type Name Description
    System.String value

    The string value representing the URI.

    System.UriKind uriKind

    The type of the URI.

    System.Collections.Generic.IEnumerable<UriScheme> uriSchemes

    A sequence of UriScheme values to use in the validation of the URI.

    Returns
    Type Description
    System.Boolean

    true if the specified value evaluates to an URI; otherwise, false.

    | Improve this Doc

    Parse(String, UriKind)

    Converts the specified string representation of an URI value to its System.Uri equivalent, limited to what is specified in the parameter.

    Declaration
    public static Uri Parse(string uriString, UriKind uriKind)
    Parameters
    Type Name Description
    System.String uriString

    A string containing the URI to convert.

    System.UriKind uriKind

    The type of the URI.

    Returns
    Type Description
    System.Uri

    An System.Uri that is equivalent to the value contained in uriString.

    Exceptions
    Type Condition
    System.ArgumentNullException

    uriString is null.

    ArgumentEmptyException

    uriString is empty.

    | Improve this Doc

    Parse(String, UriKind, IEnumerable<UriScheme>)

    Converts the specified string representation of an URI value to its System.Uri equivalent, limited to what is specified in the parameter.

    Declaration
    public static Uri Parse(string uriString, UriKind uriKind, IEnumerable<UriScheme> uriSchemes)
    Parameters
    Type Name Description
    System.String uriString

    A string containing the URI to convert.

    System.UriKind uriKind

    The type of the URI.

    System.Collections.Generic.IEnumerable<UriScheme> uriSchemes

    A sequence of UriScheme values to use in the parsing of the URI.

    Returns
    Type Description
    System.Uri

    An System.Uri that is equivalent to the value contained in uriString.

    Exceptions
    Type Condition
    System.ArgumentNullException

    uriString is null - or - uriSchemes is null.

    ArgumentEmptyException

    uriString is empty.

    | Improve this Doc

    TryParse(String, UriKind, IEnumerable<UriScheme>, out Uri)

    Converts the specified string representation of an URI value to its System.Uri equivalent, limited to what is specified in the parameter.

    Declaration
    public static bool TryParse(string uriString, UriKind uriKind, IEnumerable<UriScheme> uriSchemes, out Uri result)
    Parameters
    Type Name Description
    System.String uriString

    A string containing the URI to convert.

    System.UriKind uriKind

    The type of the URI.

    System.Collections.Generic.IEnumerable<UriScheme> uriSchemes

    A sequence of UriScheme values to use in the parsing of the URI.

    System.Uri result

    When this method returns, contains the constructed System.Uri.

    Returns
    Type Description
    System.Boolean

    true if the System.Uri was successfully created; otherwise, false.

    Remarks

    If this method returns true, the new System.Uri is in result.

    | Improve this Doc

    TryParse(String, UriKind, out Uri)

    Converts the specified string representation of an URI value to its System.Uri equivalent.

    Declaration
    public static bool TryParse(string uriString, UriKind uriKind, out Uri result)
    Parameters
    Type Name Description
    System.String uriString

    A string containing the URI to convert.

    System.UriKind uriKind

    The type of the URI.

    System.Uri result

    When this method returns, contains the constructed System.Uri.

    Returns
    Type Description
    System.Boolean

    true if the System.Uri was successfully created; otherwise, false.

    Remarks

    If this method returns true, the new System.Uri is in result.

    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX