C# Class Appccelerate.Formatters.FormatHelper

Provides functionality for formatting strings.
Show file Open project: appccelerate/appccelerate

Public Methods

Method Description
ConvertToString ( object>.IDictionary dictionary, string separator ) : string

Converts a dictionary of object, object to a string representation in the form of Key=Valueseparator.

ConvertToString ( IEnumerable collection, string separator ) : string

Converts a collection of objects to a string representation.

SecureFormat ( IFormatProvider formatProvider, string format ) : string

Replacement for the String.Format method, that throws an exception when the count of arguments does not match the count of placeholders.

If format and/or arguments are null then still a string is returned.

Tries to format with String.Format. In case of an Exception the original format string and all parameters added in a list will be returned.

Method Details

ConvertToString() public static method

Converts a dictionary of object, object to a string representation in the form of Key=Valueseparator.
public static ConvertToString ( object>.IDictionary dictionary, string separator ) : string
dictionary object>.IDictionary The dictionary.
separator string The separator to separate key value pairs.
return string

ConvertToString() public static method

Converts a collection of objects to a string representation.
public static ConvertToString ( IEnumerable collection, string separator ) : string
collection IEnumerable Collection of objects.
separator string Separator to separate objects.
return string

SecureFormat() public static method

Replacement for the String.Format method, that throws an exception when the count of arguments does not match the count of placeholders.

If format and/or arguments are null then still a string is returned.

Tries to format with String.Format. In case of an Exception the original format string and all parameters added in a list will be returned.
public static SecureFormat ( IFormatProvider formatProvider, string format ) : string
formatProvider IFormatProvider /// The format Provider. ///
format string /// The format string. ///
return string