C# Class Candor.Configuration.Provider.ProviderHelperExtensions

Extension methods to get configuration values more simply from NameValueCollection or XmlAttributeCollection
显示文件 Open project: michael-lang/candor-common

Public Methods

Method Description
GetBooleanValue ( this config, string name, System.Boolean defaultValue ) : System.Boolean

A helper method to get a boolean value from a configuration setting value.

GetDoubleValue ( this config, string name, Double defaultValue ) : double

A helper method to get an double value from a configuration setting value.

GetInt32Value ( this config, string name, Int32 defaultValue ) : Int32

A helper method to get an integer value from a configuration setting value.

GetInt64Value ( this config, string name, System.Int64 defaultValue ) : System.Int64

A helper method to get a Int64 integer value from a configuration setting value.

GetStringValue ( this config, string name, String defaultValue ) : string

A helper method to get a string value from a configuration setting value.

Method Details

GetBooleanValue() public static method

A helper method to get a boolean value from a configuration setting value.
public static GetBooleanValue ( this config, string name, System.Boolean defaultValue ) : System.Boolean
config this The available configuation values.
name string The name of the setting to retrieve.
defaultValue System.Boolean The default in case the named /// value does not exist.
return System.Boolean

GetDoubleValue() public static method

A helper method to get an double value from a configuration setting value.
public static GetDoubleValue ( this config, string name, Double defaultValue ) : double
config this The available configuation values.
name string The name of the setting to retrieve.
defaultValue Double The default in case the named /// value does not exist.
return double

GetInt32Value() public static method

A helper method to get an integer value from a configuration setting value.
public static GetInt32Value ( this config, string name, Int32 defaultValue ) : Int32
config this The available configuation values.
name string The name of the setting to retrieve.
defaultValue System.Int32 The default in case the named /// value does not exist.
return System.Int32

GetInt64Value() public static method

A helper method to get a Int64 integer value from a configuration setting value.
public static GetInt64Value ( this config, string name, System.Int64 defaultValue ) : System.Int64
config this The available configuation values.
name string The name of the setting to retrieve.
defaultValue System.Int64 The default in case the named /// value does not exist.
return System.Int64

GetStringValue() public static method

A helper method to get a string value from a configuration setting value.
public static GetStringValue ( this config, string name, String defaultValue ) : string
config this The available configuation values.
name string The name of the setting to retrieve.
defaultValue String The default in case the named /// value does not exist.
return string