C# 클래스 Sage.UrlGenerator

Implements a class that handles all link generation.
파일 보기 프로젝트 열기: igorfrance/sage

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