C# Class StringFormat.TokenStringFormat

The primary class for accessing the functionality of the StringFormat library.
Mostra file Open project: little-sharps/string_format

Public Methods

Method Description
Format ( IFormatProvider provider, string format, object>.IDictionary values ) : string

Formats the string using the placeholder for the property names.

Format ( IFormatProvider provider, string format, object values ) : string

Formats the string using the placeholder for the property names.

Format ( string format, object>.IDictionary values ) : string

Formats the string using the placeholder for the property names.

Format ( string format, object values ) : string

Formats the string using the placeholder for the property names.

TokenizeString ( string format ) : string

Returns the format string with the tokens replaced as ordinals. Exposed for developer benefit. Most likely used only in debugging.

TokenizeString ( string format, IEnumerable &tokens ) : string

Returns the format string with the tokens replaced as ordinals. Exposed for developer benefit. Most likely used only in debugging.

Private Methods

Method Description
AnonymousObjectToDictionary ( object values ) : object>.IDictionary
BuildNewToken ( string fullToken, string name, int index ) : string
IndexOfName ( IList names, string name ) : int
ParseName ( string fullToken ) : string

Method Details

Format() public static method

Formats the string using the placeholder for the property names.
public static Format ( IFormatProvider provider, string format, object>.IDictionary values ) : string
provider IFormatProvider The provider to use for formatting dates and numeric values.
format string The string to format.
values object>.IDictionary The dictionary to pull the values from.
return string

Format() public static method

Formats the string using the placeholder for the property names.
public static Format ( IFormatProvider provider, string format, object values ) : string
provider IFormatProvider The provider to use for formatting dates and numeric values.
format string The string to format.
values object The object to pull the values from. Usually an anonymous type.
return string

Format() public static method

Formats the string using the placeholder for the property names.
public static Format ( string format, object>.IDictionary values ) : string
format string The string to format.
values object>.IDictionary The dictionary to pull the values from.
return string

Format() public static method

Formats the string using the placeholder for the property names.
public static Format ( string format, object values ) : string
format string The string to format.
values object The object to pull the values from. Usually an anonymous type.
return string

TokenizeString() public static method

Returns the format string with the tokens replaced as ordinals. Exposed for developer benefit. Most likely used only in debugging.
public static TokenizeString ( string format ) : string
format string The string to format.
return string

TokenizeString() public static method

Returns the format string with the tokens replaced as ordinals. Exposed for developer benefit. Most likely used only in debugging.
public static TokenizeString ( string format, IEnumerable &tokens ) : string
format string The string to format.
tokens IEnumerable The tokens that were extracted from the format string.
return string