C# Class Sitecore.SharedSource.Commons.Utilities.ItemNameUtil

Utilities for dealing with item names
Afficher le fichier Open project: Velir/Sitecore-Commons

Méthodes publiques

Méthode Description
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.

Method Details

CleanNameOfExtraSpaces() public static méthode

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.
Résultat string

CleanNameOfHtml() public static méthode

Cleans a name of HTML tags.
public static CleanNameOfHtml ( string nameText ) : string
nameText string The name text.
Résultat string

CleanNameOfText() public static méthode

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.
Résultat string

CleanNameOfText() public static méthode

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.
Résultat string

GetForeignCharacterMap() public static méthode

Returns a Hashtable with the foreign character to english character mappings.
public static GetForeignCharacterMap ( ) : Hashtable
Résultat System.Collections.Hashtable

GetValidItemName() public static méthode

Gets the name of the valid.
public static GetValidItemName ( string nameText ) : string
nameText string The name text.
Résultat string

GetValidItemName() public static méthode

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].
Résultat string

ReplaceCharacters() public static méthode

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.
Résultat string

ReplaceForeignCharacters() public static méthode

Replaces the foreign characters in a name with their english equivalents.
public static ReplaceForeignCharacters ( string nameText ) : string
nameText string The name text.
Résultat string