Class AppSettingsConnector
Exposes a basic static API to access the AppSettings file in order to manage application settings.
Inherited Members
Namespace: BionicCode.Utilities.Net
Assembly: BionicCode.Utilities.Net.Wpf.dll
Syntax
public static class AppSettingsConnector
Methods
| Improve this Doc View SourceTryReadBool(String, out Boolean)
If exists, this method will return the corresponding value of the specified key.
Declaration
public static bool TryReadBool(string key, out bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | key | The key that maps to a specific setting. |
| Boolean | value | The actual settings Boolean value of the specified key. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
TryReadDouble(String, out Double)
If exists, this method will return the corresponding value of the specified key.
Declaration
public static bool TryReadDouble(string key, out double value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | key | The key that maps to a specific setting. |
| Double | value | The actual settings Double value of the specified key. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
TryReadInt(String, out Int32)
If exists, this method will return the corresponding value of the specified key.
Declaration
public static bool TryReadInt(string key, out int value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | key | The key that maps to a specific setting. |
| Int32 | value | The actual settings Int32 value of the specified key. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
TryReadString(String, out String)
If exists, this method will return the corresponding value of the specified key.
Declaration
public static bool TryReadString(string key, out string value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | key | The key that maps to a specific setting. |
| String | value | The actual settings String value of the specified key. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
WriteBool(String, Boolean)
Writes a Boolean value to the settings file which is stored using the specified lookup key. If the key already exists, the existing value will be overwritten.
Declaration
public static void WriteBool(string key, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | key | The lookup key for the |
| Boolean | value | The settings value to save to the file. |
WriteDouble(String, Double)
Writes a Double value to the settings file which is stored using the specified lookup key. If the key already exists, the existing value will be overwritten.
Declaration
public static void WriteDouble(string key, double value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | key | The lookup key for the |
| Double | value | The settings value to save to the file. |
WriteInt(String, Int32)
Writes a Int32 value to the settings file which is stored using the specified lookup key. If the key already exists, the existing value will be overwritten.
Declaration
public static void WriteInt(string key, int value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | key | The lookup key for the |
| Int32 | value | The settings value to save to the file. |
WriteString(String, String)
Writes a String value to the settings file which is stored using the specified lookup key. If the key already exists, the existing value will be overwritten.
Declaration
public static void WriteString(string key, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | key | The lookup key for the |
| String | value | The settings value to save to the file. |