EasySave v3.0
Loading...
Searching...
No Matches
EasySave.Gui.Services.ConfigurationHolder Class Referencesealed

Default implementation of IConfigurationHolder, keeping the current configuration in memory and delegating persistence to IConfigurationRepository. More...

Inheritance diagram for EasySave.Gui.Services.ConfigurationHolder:
EasySave.Gui.Services.IConfigurationHolder

Public Member Functions

 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
cancellationTokenToken used to cancel the asynchronous operation.

async Task SaveAsync (BackupConfiguration configuration, CancellationToken cancellationToken=default)
 Persists the provided configuration and updates Current.
Parameters
configurationConfiguration to persist.
cancellationTokenToken used to cancel the asynchronous operation.

Properties

BackupConfiguration Current [get]
 Current configuration instance shared by all tabs.

Events

EventHandler? ConfigurationChanged
Events inherited from EasySave.Gui.Services.IConfigurationHolder
EventHandler? ConfigurationChanged
 Raised whenever the configuration has been reloaded or saved.

Detailed Description

Default implementation of IConfigurationHolder, keeping the current configuration in memory and delegating persistence to IConfigurationRepository.

Constructor & Destructor Documentation

◆ ConfigurationHolder()

EasySave.Gui.Services.ConfigurationHolder.ConfigurationHolder ( IConfigurationRepository repository,
EasySavePaths paths )

Initializes a new instance of the ConfigurationHolder class.

Parameters
repositoryRepository used to load and save configuration.
pathsHelper containing the base directory for configuration files.

Member Function Documentation

◆ ReloadAsync()

async Task EasySave.Gui.Services.ConfigurationHolder.ReloadAsync ( CancellationToken cancellationToken = default)

Reloads the configuration from the underlying repository.

Parameters
cancellationTokenToken used to cancel the asynchronous operation.

Implements EasySave.Gui.Services.IConfigurationHolder.

◆ SaveAsync()

async Task EasySave.Gui.Services.ConfigurationHolder.SaveAsync ( BackupConfiguration configuration,
CancellationToken cancellationToken = default )

Persists the provided configuration and updates Current.

Parameters
configurationConfiguration to persist.
cancellationTokenToken used to cancel the asynchronous operation.

Implements EasySave.Gui.Services.IConfigurationHolder.

Property Documentation

◆ Current

BackupConfiguration EasySave.Gui.Services.ConfigurationHolder.Current
get

Current configuration instance shared by all tabs.

Implements EasySave.Gui.Services.IConfigurationHolder.


The documentation for this class was generated from the following file:
  • EasySave.Gui/Services/ConfigurationHolder.cs