PersistentSettingsConverter

public static class PersistentSettingsConverter
Used to convert string to string lists and string dictionaries and back to strings again.

Methods

IsStringDictionary

#Since v6.0
Determines if the string value is formatted as a key value pair string list.
public static bool IsStringDictionary(
s
String to check
)
Returns true if it is a XML key value pair list otherwise return false.

IsStringList

#Since v6.0
Determines if the string value is formatted as a string list.
public static bool IsStringList(
s
String to check
)
Returns true if it is a XML string list otherwise return false.

ToString

#Since v6.10
Converts a double value to a string.
public static string ToString(
value
double value
)
Returns the double value as a settings file formatted string.

ToString

#
Converts a key value string pair array to a properly formatted string dictionary XML string.
public static string ToString(
value
List of string pairs to turn into a dictionary XML string.
)
Returns a properly formatted XML string that represents the string dictionary.

ToString

#Since v6.0
Converts a string array to a properly formatted string list XML string.
public static string ToString(
values
List of strings to turn into a string list XML string.
)
Returns a properly formatted XML string that represents the list of strings.

TryParseDouble

#Since v6.10
Converts the string representation of a number to its double-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. system culture.
public static bool TryParseDouble(
s,
A string containing a number to convert.
out double
value
When this method returns, contains the double-precision floating-point number equivalent of the s parameter, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or Empty, is not a number in a valid format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.
)
Returns true if s was converted successfully; otherwise, false..

TryParseEnum

#Since v6.0
Converts an enumerated value name to its integer equivalent.
public static bool TryParseEnum(
type,
The enumerated type
enumValueName,
Enumerated value name as string
out int
value
Output value, will get set to -1 on error
)
Returns true if the successfully converted or false if not.

TryParseEnum

#Since v6.0
Converts an enumerated value string (integer as string) to a enumerated value name.
public static bool TryParseEnum(
type,
The enumerated type
intValueAsString,
enumerated integer value as string
out string
value
Output value, will be null on error
)
Returns true if the successfully converted or false if not.

TryParseStringDictionary

#
Attempts to convert a string to a key value string pair array.
public static bool TryParseStringDictionary(
s,
String to parse
value
Result will get copied here, if the string is null or empty then this will be an empty array, if there was an error parsing then this will be null otherwise it will be the string parsed as a key value string pair array.
)
Returns true if the string is not empty and properly formatted as a key value string pair list otherwise returns false.

TryParseStringList

#Since v6.0
Attempts to convert a string to a string value list.
public static bool TryParseStringList(
s,
String to parse
out string[]
value
Result will get copied here, if the string is null or empty then this will be an empty list, if there was an error parsing then this will be null otherwise it will be the string parsed as a list.
)
Returns true if the string is not empty and properly formatted as a string list otherwise returns false.