Class SettingsStore
The user's settings file and changes applied while running, as layers of the app's configuration.
Inheritance
SettingsStore
Namespace: Uniform.Matrix.Hosting
Assembly: Uniform.Matrix.Hosting.dll
public sealed class SettingsStore : ISettingsStore
Constructors
|
Edit this page
View Source
Use configuration, which must contain applied and the settings file at path.
Declaration
public SettingsStore(IConfigurationRoot configuration, AppliedConfigurationProvider applied, string path)
Parameters
Properties
|
Edit this page
View Source
Declaration
public string Path { get; }
Property Value
Methods
|
Edit this page
View Source
Add the settings file and the applied layer to builder: the file right after the other JSON files, the applied layer on top.
Declaration
public static AppliedConfigurationProvider AddLayers(IConfigurationBuilder builder, string path)
Parameters
Returns
|
Edit this page
View Source
Apply changes until the next start; a null value clears an applied change, so lower layers show again.
Declaration
public void Apply(IReadOnlyDictionary<string, string?> changes)
Parameters
|
Edit this page
View Source
Return the settings file of applicationName: settings.json in Config(string).
Declaration
public static string DefaultPath(string applicationName)
Parameters
| Type |
Name |
Description |
| string |
applicationName |
|
Returns
|
Edit this page
View Source
Return which layer sets key: applied, command line, environment, a file name, or default.
Declaration
public string GetSource(string key)
Parameters
| Type |
Name |
Description |
| string |
key |
|
Returns
|
Edit this page
View Source
Return the current value of key, e.g. Ui:InlineImages, or null when only the built-in default applies.
Declaration
public string? GetValue(string key)
Parameters
| Type |
Name |
Description |
| string |
key |
|
Returns
|
Edit this page
View Source
Read a settings file as flat keys like Ui:InlineImages; empty when it does not exist.
Declaration
public static IReadOnlyDictionary<string, string?> Read(string path)
Parameters
| Type |
Name |
Description |
| string |
path |
|
Returns
|
Edit this page
View Source
Write changes into the settings file, keeping its other settings; a null value removes the setting. The changes are applied too.
Declaration
public void Save(IReadOnlyDictionary<string, string?> changes)
Parameters
|
Edit this page
View Source
Write changes into path, keeping its other settings; the changes are applied when it is the settings file.
Declaration
public void Save(IReadOnlyDictionary<string, string?> changes, string path)
Parameters
|
Edit this page
View Source
Write changes into the settings file at path, keeping its other settings; a null value removes the setting. Nothing is applied, e.g. for an exported copy.
Declaration
public static void Write(IReadOnlyDictionary<string, string?> changes, string path)
Parameters
Implements