Search Results for

    Show / Hide Table of Contents
    View Source

    Class UrlInfo

    Represents infos for a URL.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Routing
    Assembly: Umbraco.Core.dll
    Syntax
    [DataContract(Name = "urlInfo", Namespace = "")]
    public class UrlInfo

    Constructors

    View Source

    UrlInfo(string, string, string?)

    Initializes a new instance of the UrlInfo class as a "message only" - that is, not an actual URL.

    Declaration
    public UrlInfo(string message, string provider, string? culture = null)
    Parameters
    Type Name Description
    string message
    string provider
    string culture
    View Source

    UrlInfo(Uri, string, string?, string?, bool)

    Initializes a new instance of the UrlInfo class.

    Declaration
    public UrlInfo(Uri url, string provider, string? culture, string? message = null, bool isExternal = false)
    Parameters
    Type Name Description
    Uri url
    string provider
    string culture
    string message
    bool isExternal

    Properties

    View Source

    Culture

    Gets the culture.

    Declaration
    [DataMember(Name = "culture")]
    public string? Culture { get; }
    Property Value
    Type Description
    string
    View Source

    IsExternal

    Gets whether this is considered an external or a local URL (remote or local host).

    Declaration
    [DataMember(Name = "isExternal")]
    public bool IsExternal { get; }
    Property Value
    Type Description
    bool
    View Source

    Message

    Gets the message.

    Declaration
    [DataMember(Name = "message")]
    public string? Message { get; }
    Property Value
    Type Description
    string
    View Source

    Provider

    Gets the name of the URL provider that generated this URL info.

    Declaration
    public string Provider { get; }
    Property Value
    Type Description
    string
    View Source

    Url

    Gets the URL.

    Declaration
    [DataMember(Name = "url")]
    public Uri? Url { get; }
    Property Value
    Type Description
    Uri

    Methods

    View Source

    AsMessage(string, string, string?)

    Creates a UrlInfo instance representing a message (not an actual URL).

    Declaration
    public static UrlInfo AsMessage(string message, string provider, string? culture = null)
    Parameters
    Type Name Description
    string message

    The message.

    string provider

    The name of the URL provider.

    string culture

    The optional culture.

    Returns
    Type Description
    UrlInfo

    A new UrlInfo instance.

    View Source

    AsUrl(string, string, string?, bool)

    Creates a UrlInfo instance representing an actual URL.

    Declaration
    public static UrlInfo AsUrl(string url, string provider, string? culture = null, bool isExternal = false)
    Parameters
    Type Name Description
    string url

    The URL string.

    string provider

    The name of the URL provider.

    string culture

    The optional culture.

    bool isExternal

    A value indicating whether the URL is external.

    Returns
    Type Description
    UrlInfo

    A new UrlInfo instance.

    View Source

    Equals(object?)

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    View Source

    Equals(UrlInfo?)

    Checks equality

    Declaration
    public bool Equals(UrlInfo? other)
    Parameters
    Type Name Description
    UrlInfo other
    Returns
    Type Description
    bool
    View Source

    FromUri(Uri, string, string?, bool)

    Creates a UrlInfo instance from a System.Uri.

    Declaration
    public static UrlInfo FromUri(Uri uri, string provider, string? culture = null, bool isExternal = false)
    Parameters
    Type Name Description
    Uri uri

    The URI.

    string provider

    The name of the URL provider.

    string culture

    The optional culture.

    bool isExternal

    A value indicating whether the URL is external.

    Returns
    Type Description
    UrlInfo

    A new UrlInfo instance.

    View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    Operators

    View Source

    operator ==(UrlInfo, UrlInfo)

    Determines whether two specified UrlInfo objects have the same value.

    Declaration
    public static bool operator ==(UrlInfo left, UrlInfo right)
    Parameters
    Type Name Description
    UrlInfo left

    The first UrlInfo to compare.

    UrlInfo right

    The second UrlInfo to compare.

    Returns
    Type Description
    bool

    true if the value of left is the same as the value of right; otherwise, false.

    View Source

    operator !=(UrlInfo, UrlInfo)

    Determines whether two specified UrlInfo objects have different values.

    Declaration
    public static bool operator !=(UrlInfo left, UrlInfo right)
    Parameters
    Type Name Description
    UrlInfo left

    The first UrlInfo to compare.

    UrlInfo right

    The second UrlInfo to compare.

    Returns
    Type Description
    bool

    true if the value of left is different from the value of right; otherwise, false.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX