C# Class Rsdn.Framework.Formatting.FormatterHelper

ファイルを表示 Open project: rsdn/RsdnFormatter

Public Methods

Method Description
EncodeAgainstXSS ( this value ) : string

Подготавливает текст для предотовращения XSS (Cross Site Scripting) Используется, в основном для кодирования адресов (ссылок, картинок).

EncodeJScriptText ( this str ) : string

Подготавливает текст для JScript.

ExtractTags ( this tags, MatchEvaluator eval ) : string

Format tags

ExtractTags ( this tags ) : string[]

Extract tags from string

GetCodeFormatter ( [ name ) : Rsdn.Framework.Formatting.CodeFormatter

Returns code formatter by language name.

GetCodeTagNames ( ) : IEnumerable

Returns all known tag names.

IsEmpty ( [ sb ) : bool

Returns true is StringBuilder is empty.

RemoveQuotations ( string msg ) : string

Убирает цитирование из текста сообщения.

Replace ( [ regex, [ input, [ replacement ) : System.StringBuilder

Replace parts of StringBuilder by Regex.

ReplaceTags ( this str ) : string

Заменяет служебные символы HTML на их аналоги.

ReplaceTagsWQ ( this sb ) : System.StringBuilder

Заменяет служебные символы HTML на их аналоги исключая '"'.

ReplaceTagsWQ ( this str ) : string

Заменяет служебные символы HTML на их аналоги исключая '"'.

ToDouble ( this o ) : double

Преобразует object в double. В случае возникновения исключения возвращается 0.

ToInt ( this o ) : int

Преобразует object в int. В случае возникновения исключения возвращается 0.

ToInt ( this o, int errorValue ) : int

Преобразует object в int. В случае возникновения исключения возвращается errorValue.

Trim ( [ sb, [ trimChars ) : System.StringBuilder

Trim sides of string.

Private Methods

Method Description
FormatterHelper ( ) : System
GetCodeFormatterByTag ( [ tagName ) : Rsdn.Framework.Formatting.CodeFormatter
GetLangInfos ( ) : IEnumerable
MarkupCode ( [ langName, [ source ) : string
MarkupCodeByTag ( [ tagName, [ source ) : string
RetrieveLangInfo ( Stream stream ) : Rsdn.Framework.Formatting.CodeLangInfo
TrimLeft ( [ sb, [ trimChars ) : System.StringBuilder
TrimRight ( [ sb, [ trimChars ) : System.StringBuilder

Method Details

EncodeAgainstXSS() public static method

Подготавливает текст для предотовращения XSS (Cross Site Scripting) Используется, в основном для кодирования адресов (ссылок, картинок).
public static EncodeAgainstXSS ( this value ) : string
value this Исходный текст.
return string

EncodeJScriptText() public static method

Подготавливает текст для JScript.
public static EncodeJScriptText ( this str ) : string
str this Исходная строка.
return string

ExtractTags() public static method

Format tags
public static ExtractTags ( this tags, MatchEvaluator eval ) : string
tags this
eval MatchEvaluator Tag transformer
return string

ExtractTags() public static method

Extract tags from string
public static ExtractTags ( this tags ) : string[]
tags this
return string[]

GetCodeFormatter() public static method

Returns code formatter by language name.
public static GetCodeFormatter ( [ name ) : Rsdn.Framework.Formatting.CodeFormatter
name [
return Rsdn.Framework.Formatting.CodeFormatter

GetCodeTagNames() public static method

Returns all known tag names.
public static GetCodeTagNames ( ) : IEnumerable
return IEnumerable

IsEmpty() public static method

Returns true is StringBuilder is empty.
public static IsEmpty ( [ sb ) : bool
sb [
return bool

RemoveQuotations() public static method

Убирает цитирование из текста сообщения.
public static RemoveQuotations ( string msg ) : string
msg string Сообщение.
return string

Replace() public static method

Replace parts of StringBuilder by Regex.
public static Replace ( [ regex, [ input, [ replacement ) : System.StringBuilder
regex [
input [
replacement [
return System.StringBuilder

ReplaceTags() public static method

Заменяет служебные символы HTML на их аналоги.
public static ReplaceTags ( this str ) : string
str this Исходный текст.
return string

ReplaceTagsWQ() public static method

Заменяет служебные символы HTML на их аналоги исключая '"'.
public static ReplaceTagsWQ ( this sb ) : System.StringBuilder
sb this Исходный текст.
return System.StringBuilder

ReplaceTagsWQ() public static method

Заменяет служебные символы HTML на их аналоги исключая '"'.
public static ReplaceTagsWQ ( this str ) : string
str this Исходный текст.
return string

ToDouble() public static method

Преобразует object в double. В случае возникновения исключения возвращается 0.
public static ToDouble ( this o ) : double
o this Преобразуемый объект.
return double

ToInt() public static method

Преобразует object в int. В случае возникновения исключения возвращается 0.
public static ToInt ( this o ) : int
o this Преобразуемый объект.
return int

ToInt() public static method

Преобразует object в int. В случае возникновения исключения возвращается errorValue.
public static ToInt ( this o, int errorValue ) : int
o this Преобразуемый объект.
errorValue int Значение возвращаемое если произошла ошибка.
return int

Trim() public static method

Trim sides of string.
public static Trim ( [ sb, [ trimChars ) : System.StringBuilder
sb [
trimChars [
return System.StringBuilder