IConfigurationStorage Interface |
Namespace: VirtualRadar.Interface.Settings
The IConfigurationStorage type exposes the following members.
Name | Description | |
---|---|---|
Folder |
Gets or sets the folder the contains the configuration and log files.
| |
Provider |
Gets or sets a value that abstracts away the environment for testing purposes.
| |
Singleton |
Gets the single instance of the class that should be used throughout the application.
(Inherited from ISingletonT.) |
Name | Description | |
---|---|---|
Erase |
Deletes all of the configuration settings, resetting everything back to factory settings.
| |
Load |
Loads the current configuration for the user.
| |
Save |
Saves the configuration for the user.
|
Name | Description | |
---|---|---|
ConfigurationChanged |
Raised after Save(Configuration) has saved a new configuration to disk or Erase has deleted the user's configuration.
|
IConfigurationStorage storage = Factory.Singleton.Resolve<IConfigurationStorage>().Singleton; Configuration configuration = storage.Load();
IConfigurationStorage storage = Factory.Singleton.Resolve<IConfigurationStorage>().Singleton;
Configuration configuration = storage.Load();
configuration.AudioSettings.Enabled = false;
storage.Save(configuration);
private void SetupMyObject() { IConfigurationStorage storage = Factory.Singleton.Resolve<IConfigurationStorage>().Singleton; storage.ConfigurationChanged += ConfigurationStorage_ConfigurationChanged; } private void ConfigurationStorage_ConfigurationChanged(object sender, EventArgs args) { // reload and apply new configuration here }