C# Класс Sage.UrlGenerator

Implements a class that handles all link generation.
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
FormatAndRewriteUrl string
FormatPattern string
GetLinkFunction string
GetProjectLinkFunction string
GetSelfFunction string
ProcessHrefAttribute System.Xml.XmlNode
ProcessSageBaseHrefElement System.Xml.XmlNode
ProcessSageLinkElement System.Xml.XmlNode
ProcessSageUrlElement System.Xml.XmlNode

Открытые методы

Метод Описание
GetUrl ( XmlElement linkElement ) : string

Resolves a link href based on the attributes of the specified linkElement.

The attributes on the element that will be taken into account:

Attribute Description id The id of the URL of the link to resolve:

<sage:link id="CustomerSuport" />

values To add formatting values to the resulting URL, such as the ID of the current customer, use the values attribute:

<sage:link id="CustomerSuport" values="id=${CustomerID}"/>

encode To URL-encode the resulting URL, use the encode attribute and set it's value to "1", "true", or "yes".
GetUrl ( string linkName, NameValueCollection query = null, string hashString = null, bool qualify = false ) : string

Generates the specified link, using the name/value pairs from the specified query to format it.

GetUrl ( string linkName, string query, string hashString = null, bool qualify = false ) : string

Generates the specified link, using the name/value pairs from the specified query to format it.

PrefixUrl ( string url ) : string

Returns the specified url with the current ServerPrefix (if any) pre-pended to it.

UrlGenerator ( SageContext context ) : System

Initializes a new instance of the UrlGenerator class, using the specified context.

Приватные методы

Метод Описание
FormatAndRewriteUrl ( string linkName, NameValueCollection parameters, string hashString = null, bool qualify = false ) : string

Formats and rewrites the link pattern with the specified linkName.

FormatPattern ( string pattern, NameValueCollection parameters ) : string
GetLinkFunction ( SageContext context ) : string
GetProjectLinkFunction ( SageContext context ) : string
GetSelfFunction ( SageContext context ) : string
ProcessHrefAttribute ( SageContext context, XmlNode node ) : XmlNode
ProcessSageBaseHrefElement ( SageContext context, XmlNode node ) : XmlNode
ProcessSageLinkElement ( SageContext context, XmlNode node ) : XmlNode
ProcessSageUrlElement ( SageContext context, XmlNode node ) : XmlNode

Описание методов

GetUrl() публичный Метод

Resolves a link href based on the attributes of the specified linkElement.

The attributes on the element that will be taken into account:

Attribute Description id The id of the URL of the link to resolve:

<sage:link id="CustomerSuport" />

values To add formatting values to the resulting URL, such as the ID of the current customer, use the values attribute:

<sage:link id="CustomerSuport" values="id=${CustomerID}"/>

encode To URL-encode the resulting URL, use the encode attribute and set it's value to "1", "true", or "yes".
public GetUrl ( XmlElement linkElement ) : string
linkElement System.Xml.XmlElement The element that contains attributes that define the link to resolve.
Результат string

GetUrl() публичный Метод

Generates the specified link, using the name/value pairs from the specified query to format it.
public GetUrl ( string linkName, NameValueCollection query = null, string hashString = null, bool qualify = false ) : string
linkName string The name of the link to get.
query System.Collections.Specialized.NameValueCollection The query to use for formatting the link.
hashString string The browser hash string to append to the end of the URL.
qualify bool If set to true the resulting URL will be prefixed with .
Результат string

GetUrl() публичный Метод

Generates the specified link, using the name/value pairs from the specified query to format it.
public GetUrl ( string linkName, string query, string hashString = null, bool qualify = false ) : string
linkName string The name of the link to generate.
query string The query to use for formatting the link.
hashString string The browser hash string to append to the end of the URL.
qualify bool If set to true the resulting URL will be prefixed with .
Результат string

PrefixUrl() публичный Метод

Returns the specified url with the current ServerPrefix (if any) pre-pended to it.
/// is null. ///
public PrefixUrl ( string url ) : string
url string The URL to process.
Результат string

UrlGenerator() публичный Метод

Initializes a new instance of the UrlGenerator class, using the specified context.
public UrlGenerator ( SageContext context ) : System
context SageContext The current .
Результат System