Default implementation of IConfigurationHolder, keeping the current configuration in memory and delegating persistence to IConfigurationRepository.
More...
|
| | ConfigurationHolder (IConfigurationRepository repository, EasySavePaths paths) |
| | Initializes a new instance of the ConfigurationHolder class.
|
|
| ConfigurationHolder (IConfigurationRepository repository, Func< string > getBaseDirectory) |
| | Initializes with a delegate to resolve the base directory at runtime (e.g. for mutable paths).
|
| async Task | ReloadAsync (CancellationToken cancellationToken=default) |
| | Reloads the configuration from the underlying repository.- Parameters
-
| cancellationToken | Token used to cancel the asynchronous operation. |
|
| async Task | SaveAsync (BackupConfiguration configuration, CancellationToken cancellationToken=default) |
| | Persists the provided configuration and updates Current.- Parameters
-
| configuration | Configuration to persist. |
| cancellationToken | Token used to cancel the asynchronous operation. |
|
|
|
EventHandler? | ConfigurationChanged |
|
EventHandler? | ConfigurationChanged |
| | Raised whenever the configuration has been reloaded or saved.
|
Default implementation of IConfigurationHolder, keeping the current configuration in memory and delegating persistence to IConfigurationRepository.
◆ ConfigurationHolder()
Initializes a new instance of the ConfigurationHolder class.
- Parameters
-
| repository | Repository used to load and save configuration. |
| paths | Helper containing the base directory for configuration files. |
◆ ReloadAsync()
| async Task EasySave.Gui.Services.ConfigurationHolder.ReloadAsync |
( |
CancellationToken | cancellationToken = default | ) |
|
◆ SaveAsync()
| async Task EasySave.Gui.Services.ConfigurationHolder.SaveAsync |
( |
BackupConfiguration | configuration, |
|
|
CancellationToken | cancellationToken = default ) |
◆ Current
The documentation for this class was generated from the following file:
- EasySave.Gui/Services/ConfigurationHolder.cs