Class FileConfigurationProvider
- Namespace
- RetailForce.Fiscalisation.Configuration
- Assembly
- RetailForce.Fiscalisation.Model.dll
Configuration provider with file access (one file for all clients).
public class FileConfigurationProvider : JsonConfigurationProviderBase
- Inheritance
-
FileConfigurationProvider
- Inherited Members
Constructors
FileConfigurationProvider(string, ILogger)
Constructor.
public FileConfigurationProvider(string configurationFile, ILogger logger)
Parameters
configurationFilestringThe path to the configuration file. If no configuration file is found a new one is created.
loggerILoggerThe logger to log checksum errors.
Exceptions
- DirectoryNotFoundException
Thrown if the path of the given
configurationFileis not found.- ArgumentNullException
Thrown if parameter
configurationFileis set to null or empty string.- ArgumentNullException
Thrown if parameter
loggeris set to null.
Methods
LoadConfiguration()
Loads the configuration into memory from the appropriate store.
protected override void LoadConfiguration()
StoreConfiguration()
Stores the configuration from memory into the appropriate store.
protected override void StoreConfiguration()
ValidateChecksum()
Validates configuration file with checksum file.
public bool ValidateChecksum()
Returns
- bool
True if validation was successful and file was not changed; otherwise false.