C# Класс Sitecore.SharedSource.Commons.Utilities.ItemNameUtil

Utilities for dealing with item names
Показать файл Открыть проект

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

Метод Описание
CleanNameOfExtraSpaces ( string nameText ) : string

Cleans the name of extra spaces both internally and at the beginning and end of the name.

CleanNameOfHtml ( string nameText ) : string

Cleans a name of HTML tags.

CleanNameOfText ( string nameText, List textToStrip ) : string

Cleans the name of a list of strings.

CleanNameOfText ( string nameText, string regularExpression ) : string

Replace any text matching the passed in regular expression with a blank string.

GetForeignCharacterMap ( ) : Hashtable

Returns a Hashtable with the foreign character to english character mappings.

GetValidItemName ( string nameText ) : string

Gets the name of the valid.

GetValidItemName ( string nameText, bool stripTags, bool replaceForeignCharacters ) : string

Returns a valid item name for the passed in text

ReplaceCharacters ( string nameText, Hashtable characterMap ) : string

Takes the passed in characters (the keys in the Hashtable) and replaces them with the Hashtable key value.

ReplaceForeignCharacters ( string nameText ) : string

Replaces the foreign characters in a name with their english equivalents.

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

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

Cleans the name of extra spaces both internally and at the beginning and end of the name.
public static CleanNameOfExtraSpaces ( string nameText ) : string
nameText string The name text.
Результат string

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

Cleans a name of HTML tags.
public static CleanNameOfHtml ( string nameText ) : string
nameText string The name text.
Результат string

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

Cleans the name of a list of strings.
public static CleanNameOfText ( string nameText, List textToStrip ) : string
nameText string The name text to strip text from.
textToStrip List The text to strip.
Результат string

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

Replace any text matching the passed in regular expression with a blank string.
public static CleanNameOfText ( string nameText, string regularExpression ) : string
nameText string The name text.
regularExpression string The regular expression.
Результат string

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

Returns a Hashtable with the foreign character to english character mappings.
public static GetForeignCharacterMap ( ) : Hashtable
Результат System.Collections.Hashtable

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

Gets the name of the valid.
public static GetValidItemName ( string nameText ) : string
nameText string The name text.
Результат string

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

Returns a valid item name for the passed in text
public static GetValidItemName ( string nameText, bool stripTags, bool replaceForeignCharacters ) : string
nameText string The name text.
stripTags bool if set to true [strip tags].
replaceForeignCharacters bool if set to true [replace foreign characters].
Результат string

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

Takes the passed in characters (the keys in the Hashtable) and replaces them with the Hashtable key value.
public static ReplaceCharacters ( string nameText, Hashtable characterMap ) : string
nameText string The name text.
characterMap System.Collections.Hashtable The character map.
Результат string

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

Replaces the foreign characters in a name with their english equivalents.
public static ReplaceForeignCharacters ( string nameText ) : string
nameText string The name text.
Результат string