Class BowirePluginSettingsStore
- Namespace
- Kuestenlogik.Bowire.Plugins
- Assembly
- Kuestenlogik.Bowire.dll
Reads and writes the values behind Settings (#640).
public sealed class BowirePluginSettingsStore : IBowirePluginSettings
- Inheritance
-
BowirePluginSettingsStore
- Implements
- Inherited Members
Remarks
One file per workspace, at plugin-settings.json under the workspace
path, in the shape it is diffed in:
{ "dis": { "probeDuration": "5" }, "mqtt": { "scanDuration": "10" } }
Values are strings on the wire and in the file. The schema declares a type, but the browser sends what a form control produced, and a store that re-interprets that on the way in has to agree with whatever the plugin expects on the way out. Keeping them opaque here puts the one conversion at the point that knows what the value means — the accessors on IBowirePluginSettings.
Cached per resolved path. One host serves several workspaces, so a single cache would hand one workspace's probe window to another — the shape of defect #284 removed from the disabled-plugins list.
Constructors
BowirePluginSettingsStore()
public BowirePluginSettingsStore()
Methods
GetValue(string, string)
The raw value for key, or null when nobody
set one.
public string? GetValue(string pluginId, string key)
Parameters
Returns
Set(string, string, string?)
Set key for pluginId, or clear it
when value is null.
public bool Set(string pluginId, string key, string? value)
Parameters
Returns
- bool
Whether anything was written.
Remarks
Clearing rather than storing an empty string, so "set back to the default" and "set to nothing" stay different states — the second is what a plugin would have to guess about.
Snapshot()
Every value set for the workspace in scope.
public IReadOnlyDictionary<string, IReadOnlyDictionary<string, string>> Snapshot()