Class ConfigurationReader
Helper class to read parsed values from a System.Collections.Specialized.NameValueCollection.
Inheritance
Inherited Members
Namespace: Mediachase.Commerce.Internal
Assembly: Mediachase.Commerce.dll
Version: 13.30.0Syntax
public class ConfigurationReader
Constructors
ConfigurationReader(NameValueCollection)
Initializes a new instance of the ConfigurationReader class.
Declaration
public ConfigurationReader(NameValueCollection configValues)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NameValueCollection | configValues |
Methods
ReadBool(String)
Reads a boolean value.
Declaration
public bool? ReadBool(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key to read the value for. |
Returns
Type | Description |
---|---|
System.Nullable<System.Boolean> | The parsed value, or null if the key was not found. |
ReadCsv(String, Char[])
Reads comma separated string.
Declaration
public IEnumerable<string> ReadCsv(string key, params char[] separator)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key to read the value for. |
System.Char[] | separator | Optional separators. If none is provided, ';' is used. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | The values, or null if the key was not found. |
ReadInt(String)
Reads an integer value.
Declaration
public int? ReadInt(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key to read the value for. |
Returns
Type | Description |
---|---|
System.Nullable<System.Int32> | The parsed value, or null if the key was not found. |
ReadString(String)
Reads a string value.
Declaration
public string ReadString(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key to read the value for. |
Returns
Type | Description |
---|---|
System.String | The value, or null if the key was not found. |