C# Класс SmartFormat.Core.Parsing.Parser

Parses a format string.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
AddAdditionalSelectorChars ( string chars ) : void

Adds specific characters to the allowed selector chars.

AddAlphanumericSelectors ( ) : void

Includes a-z and A-Z in the list of allowed selector chars.

AddOperators ( string chars ) : void

Adds specific characters to the allowed operator chars. An operator is a character that is in the selector string that splits the selectors.

ParseFormat ( string format, string formatterExtensionNames ) : Format
Parser ( ErrorAction errorAction = ErrorAction.Ignore ) : System
UseAlternativeBraces ( char opening, char closing ) : void
UseAlternativeEscapeChar ( char alternativeEscapeChar = '\\' ) : void

Sets the AlternativeEscaping option to True so that braces will only be escaped after the specified character.

UseBraceEscaping ( ) : void

[Default] Uses {{ and }} for escaping braces for compatibility with String.Format. However, this does not work very well with nested placeholders, so it is recommended to use an alternative escape char.

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

Метод Описание
FormatterNameExists ( string name, string formatterExtensionNames ) : bool

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

AddAdditionalSelectorChars() публичный Метод

Adds specific characters to the allowed selector chars.
public AddAdditionalSelectorChars ( string chars ) : void
chars string
Результат void

AddAlphanumericSelectors() публичный Метод

Includes a-z and A-Z in the list of allowed selector chars.
public AddAlphanumericSelectors ( ) : void
Результат void

AddOperators() публичный Метод

Adds specific characters to the allowed operator chars. An operator is a character that is in the selector string that splits the selectors.
public AddOperators ( string chars ) : void
chars string
Результат void

ParseFormat() публичный Метод

public ParseFormat ( string format, string formatterExtensionNames ) : Format
format string
formatterExtensionNames string
Результат Format

Parser() публичный Метод

public Parser ( ErrorAction errorAction = ErrorAction.Ignore ) : System
errorAction ErrorAction
Результат System

UseAlternativeBraces() публичный Метод

public UseAlternativeBraces ( char opening, char closing ) : void
opening char
closing char
Результат void

UseAlternativeEscapeChar() публичный Метод

Sets the AlternativeEscaping option to True so that braces will only be escaped after the specified character.
public UseAlternativeEscapeChar ( char alternativeEscapeChar = '\\' ) : void
alternativeEscapeChar char Defaults to backslash
Результат void

UseBraceEscaping() публичный Метод

[Default] Uses {{ and }} for escaping braces for compatibility with String.Format. However, this does not work very well with nested placeholders, so it is recommended to use an alternative escape char.
public UseBraceEscaping ( ) : void
Результат void