C# Класс Upac.Core.Utilities.XsltExtension

Показать файл Открыть проект

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

Метод Описание
Clip ( string text, int maxLength, bool ellipsis ) : string

Clips the specified text if the text is bigger than the maxLength provided.

CreateEmptyIterator ( ) : XPathNodeIterator

Creates the empty iterator. Used only internel by this class

CreateForLoop ( int to ) : XPathNodeIterator

Creates XML that can be used as a foor loop. Starting from 1 and to the provided to parameter.

CreateForLoop ( int from, int to ) : XPathNodeIterator

Creates XML that can be used as a foor loop. Starting from parameter from and to the provided to parameter.

CreateRfc822Date ( string isodate ) : string

Returns the RFC822 datetime format for the specified isodate. RFC822 should be used when generating rss feeds etc

FetchFeedAndNormaliseToAtom ( string url ) : XPathNodeIterator

Fetches a external rss/atom feed and normalise it to atom schema.

FormatIsoDate ( string isodate, string fieldNameInSettings ) : string

Formats the iso date.

FormatIsoDateLong ( string isodate ) : string

Formats the iso date long.

FormatIsoDateShort ( string isodate ) : string

Formats the iso date short.

FormatIsoDateTime ( string isodate ) : string

Formats the iso to date and time.

FormatIsoTime ( string isodate ) : string

Formats the iso to time.

GetCurrentCultureName ( ) : string

Gets the name of the current culture.

GetDescendantsViaXPath ( XPathNodeIterator from, string xpath ) : XPathNodeIterator
GetDictionaryItem ( string key ) : string

Gets a dictionary item from Umbraco. If querystring parameter debug exists a debug span is also provided.

GetFileExtension ( string filename ) : string

Gets the file extension.

GetHomeNode ( ) : XPathNodeIterator

Gets the home node.

GetImageTag ( string imagePathOrMediaId ) : string

Gets an xhtml image tag via the provided media id or image path.

GetImageTag ( string imagePathOrMediaId, int maxWidth ) : string

Gets an xhtml image tag via the provided media id or image path

GetImageTag ( string imagePathOrMediaId, int maxWidth, int maxHeight ) : string
GetImageTag ( string imagePathOrMediaId, int maxWidth, int maxHeight, bool constrain ) : string
GetLinkTag ( string nodeId ) : string

Get a link tag

Gets a link tag where the href points to the node and text will come from GetMenuTitle

GetLinkTag ( string nodeId, string linkText ) : string

Get a link tag with overload for the link text

Gets a link tag where the href points to the node and you have provided the link text

GetLinkTag ( string nodeId, string linkText, string cssClass ) : string

Get a link tag with overload for the link text and a css class to add to the a tag.

Gets a link tag where the href points to the node and you can add a css class

GetMediaPath ( int mediaId ) : string

Gets the media path via a media id

GetOEmbedHtml ( string url, string maxWidth, string maxHeight ) : string

Gets the OEmbed HTML.

GetReadableFileSizeViaBytes ( string bytes ) : string

Gets the readable file size via bytes.

GetTemplateIdFromAlias ( string templateAlias ) : int
GetThumbnailUrl ( string imagePathOrMediaId, int width ) : string
GetThumbnailUrl ( string imagePathOrMediaId, int width, int height ) : string
GetThumbnailUrl ( string imagePathOrMediaId, int width, int height, bool constrain ) : string
IsInUpacDebug ( ) : bool
IsoDateNow ( ) : string
MenuInclude ( XPathNodeIterator ni ) : bool

A simple method which returns true if the node should be included in navigations. The following things must be true 1. The node must not have set the property hideFromNavigation true. 2. The node must have a template associated

MenuTitle ( XPathNodeIterator ni ) : string
ToBool ( string input ) : bool

Converts a string to a bool. If the input string is equal 1 true is returned otherwise false.

ToNumber ( string input, int defaultNumber ) : int

Converts a string to a number. If the input string is empty or can not be converted, the defaultNumber is returned instead.

UrlViaNodeId ( string nodeId ) : string

Get the url to a node via node id.

This method also handles redirect nodes which can point to internal or external pages.

UrlViaNodeId ( string nodeId, string alternateTemplate ) : string

Get the url to a node via node id and appending the provided alternate template

UrlViaNodeId ( string nodeId, string alternateTemplate, bool includeDomain ) : string

Get the url to a node via node id and appending the provided alternate template and can include the domain incl. http://

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

Метод Описание
GetImageTag ( string imagePath, string altText ) : string

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

Clip() публичный статический Метод

Clips the specified text if the text is bigger than the maxLength provided.
public static Clip ( string text, int maxLength, bool ellipsis ) : string
text string The text to be clipped.
maxLength int Max length of the returned string.
ellipsis bool if set to true show ellipsis (...)
Результат string

CreateEmptyIterator() публичный статический Метод

Creates the empty iterator. Used only internel by this class
public static CreateEmptyIterator ( ) : XPathNodeIterator
Результат System.Xml.XPath.XPathNodeIterator

CreateForLoop() публичный статический Метод

Creates XML that can be used as a foor loop. Starting from 1 and to the provided to parameter.
public static CreateForLoop ( int to ) : XPathNodeIterator
to int ending point
Результат System.Xml.XPath.XPathNodeIterator

CreateForLoop() публичный статический Метод

Creates XML that can be used as a foor loop. Starting from parameter from and to the provided to parameter.
public static CreateForLoop ( int from, int to ) : XPathNodeIterator
from int Start int
to int End int
Результат System.Xml.XPath.XPathNodeIterator

CreateRfc822Date() публичный статический Метод

Returns the RFC822 datetime format for the specified isodate. RFC822 should be used when generating rss feeds etc
public static CreateRfc822Date ( string isodate ) : string
isodate string
Результат string

FetchFeedAndNormaliseToAtom() публичный статический Метод

Fetches a external rss/atom feed and normalise it to atom schema.
public static FetchFeedAndNormaliseToAtom ( string url ) : XPathNodeIterator
url string The external URL for the feed to fetch.
Результат System.Xml.XPath.XPathNodeIterator

FormatIsoDate() публичный статический Метод

Formats the iso date.
public static FormatIsoDate ( string isodate, string fieldNameInSettings ) : string
isodate string The isodate.
fieldNameInSettings string The field name in settings.
Результат string

FormatIsoDateLong() публичный статический Метод

Formats the iso date long.
public static FormatIsoDateLong ( string isodate ) : string
isodate string The isodate.
Результат string

FormatIsoDateShort() публичный статический Метод

Formats the iso date short.
public static FormatIsoDateShort ( string isodate ) : string
isodate string The isodate.
Результат string

FormatIsoDateTime() публичный статический Метод

Formats the iso to date and time.
public static FormatIsoDateTime ( string isodate ) : string
isodate string The isodate.
Результат string

FormatIsoTime() публичный статический Метод

Formats the iso to time.
public static FormatIsoTime ( string isodate ) : string
isodate string The isodate.
Результат string

GetCurrentCultureName() публичный статический Метод

Gets the name of the current culture.
public static GetCurrentCultureName ( ) : string
Результат string

GetDescendantsViaXPath() публичный статический Метод

public static GetDescendantsViaXPath ( XPathNodeIterator from, string xpath ) : XPathNodeIterator
from System.Xml.XPath.XPathNodeIterator
xpath string
Результат System.Xml.XPath.XPathNodeIterator

GetDictionaryItem() публичный статический Метод

Gets a dictionary item from Umbraco. If querystring parameter debug exists a debug span is also provided.
public static GetDictionaryItem ( string key ) : string
key string The dictionary key
Результат string

GetFileExtension() публичный статический Метод

Gets the file extension.
public static GetFileExtension ( string filename ) : string
filename string The filename.
Результат string

GetHomeNode() публичный статический Метод

Gets the home node.
public static GetHomeNode ( ) : XPathNodeIterator
Результат System.Xml.XPath.XPathNodeIterator

GetImageTag() публичный статический Метод

Gets an xhtml image tag via the provided media id or image path.
public static GetImageTag ( string imagePathOrMediaId ) : string
imagePathOrMediaId string The image path or media id.
Результат string

GetImageTag() публичный статический Метод

Gets an xhtml image tag via the provided media id or image path
public static GetImageTag ( string imagePathOrMediaId, int maxWidth ) : string
imagePathOrMediaId string The image path or media id.
maxWidth int Max width.
Результат string

GetImageTag() публичный статический Метод

public static GetImageTag ( string imagePathOrMediaId, int maxWidth, int maxHeight ) : string
imagePathOrMediaId string
maxWidth int
maxHeight int
Результат string

GetImageTag() публичный статический Метод

public static GetImageTag ( string imagePathOrMediaId, int maxWidth, int maxHeight, bool constrain ) : string
imagePathOrMediaId string
maxWidth int
maxHeight int
constrain bool
Результат string

GetLinkTag() публичный статический Метод

Get a link tag
Gets a link tag where the href points to the node and text will come from GetMenuTitle
public static GetLinkTag ( string nodeId ) : string
nodeId string The node id.
Результат string

GetLinkTag() публичный статический Метод

Get a link tag with overload for the link text
Gets a link tag where the href points to the node and you have provided the link text
public static GetLinkTag ( string nodeId, string linkText ) : string
nodeId string The node id.
linkText string The link text.
Результат string

GetLinkTag() публичный статический Метод

Get a link tag with overload for the link text and a css class to add to the a tag.
Gets a link tag where the href points to the node and you can add a css class
public static GetLinkTag ( string nodeId, string linkText, string cssClass ) : string
nodeId string The node id.
linkText string The link text.
cssClass string Css class
Результат string

GetMediaPath() публичный статический Метод

Gets the media path via a media id
public static GetMediaPath ( int mediaId ) : string
mediaId int The media id.
Результат string

GetOEmbedHtml() публичный статический Метод

Gets the OEmbed HTML.
public static GetOEmbedHtml ( string url, string maxWidth, string maxHeight ) : string
url string The OEmbed URL/Source.
maxWidth string Width of the max.
maxHeight string Height of the max.
Результат string

GetReadableFileSizeViaBytes() публичный статический Метод

Gets the readable file size via bytes.
public static GetReadableFileSizeViaBytes ( string bytes ) : string
bytes string The bytes.
Результат string

GetTemplateIdFromAlias() публичный статический Метод

public static GetTemplateIdFromAlias ( string templateAlias ) : int
templateAlias string
Результат int

GetThumbnailUrl() публичный статический Метод

public static GetThumbnailUrl ( string imagePathOrMediaId, int width ) : string
imagePathOrMediaId string
width int
Результат string

GetThumbnailUrl() публичный статический Метод

public static GetThumbnailUrl ( string imagePathOrMediaId, int width, int height ) : string
imagePathOrMediaId string
width int
height int
Результат string

GetThumbnailUrl() публичный статический Метод

public static GetThumbnailUrl ( string imagePathOrMediaId, int width, int height, bool constrain ) : string
imagePathOrMediaId string
width int
height int
constrain bool
Результат string

IsInUpacDebug() публичный статический Метод

public static IsInUpacDebug ( ) : bool
Результат bool

IsoDateNow() публичный статический Метод

public static IsoDateNow ( ) : string
Результат string

MenuInclude() публичный статический Метод

A simple method which returns true if the node should be included in navigations. The following things must be true 1. The node must not have set the property hideFromNavigation true. 2. The node must have a template associated
public static MenuInclude ( XPathNodeIterator ni ) : bool
ni System.Xml.XPath.XPathNodeIterator The node to check.
Результат bool

MenuTitle() публичный статический Метод

public static MenuTitle ( XPathNodeIterator ni ) : string
ni System.Xml.XPath.XPathNodeIterator
Результат string

ToBool() публичный статический Метод

Converts a string to a bool. If the input string is equal 1 true is returned otherwise false.
public static ToBool ( string input ) : bool
input string The input to be converted
Результат bool

ToNumber() публичный статический Метод

Converts a string to a number. If the input string is empty or can not be converted, the defaultNumber is returned instead.
public static ToNumber ( string input, int defaultNumber ) : int
input string The input to be converted
defaultNumber int The default number to return if the input can not be converted.
Результат int

UrlViaNodeId() публичный статический Метод

Get the url to a node via node id.
This method also handles redirect nodes which can point to internal or external pages.
public static UrlViaNodeId ( string nodeId ) : string
nodeId string The node id.
Результат string

UrlViaNodeId() публичный статический Метод

Get the url to a node via node id and appending the provided alternate template
public static UrlViaNodeId ( string nodeId, string alternateTemplate ) : string
nodeId string The node id.
alternateTemplate string The alternate template.
Результат string

UrlViaNodeId() публичный статический Метод

Get the url to a node via node id and appending the provided alternate template and can include the domain incl. http://
public static UrlViaNodeId ( string nodeId, string alternateTemplate, bool includeDomain ) : string
nodeId string The node id.
alternateTemplate string The alternate template. May be empty.
includeDomain bool if set to true include domain and http.
Результат string