SettingsManager Class#
Orchestrates the extension settings lifecycle: restore on open, save on close, update on change. Parallels LayoutManager in managing persisted metadata through the NotebookModel.
public sealed class SettingsManager
Inheritance System.Object → SettingsManager
Methods#
GetAllDefinitions() Method#
Gets all setting definitions from all extensions that implement IExtensionSettings.
public System.Collections.Generic.IReadOnlyList<(string ExtensionId,System.Collections.Generic.IReadOnlyList<Verso.Abstractions.SettingDefinition> Definitions)> GetAllDefinitions();
Returns#
System.Collections.Generic.IReadOnlyList<<System.String,System.Collections.Generic.IReadOnlyList<SettingDefinition>>>
Refresh(IReadOnlyList<IExtensionSettings>) Method#
Replaces the settable extensions list with an updated snapshot.
public void Refresh(System.Collections.Generic.IReadOnlyList<Verso.Abstractions.IExtensionSettings> updatedExtensions);
Parameters#
updatedExtensions System.Collections.Generic.IReadOnlyList<IExtensionSettings>
ResetSettingAsync(string, string) Method#
Resets a single setting to its default value.
public System.Threading.Tasks.Task ResetSettingAsync(string extensionId, string settingName);
Parameters#
extensionId System.String
settingName System.String
Returns#
RestoreSettingsAsync(NotebookModel) Method#
Restores persisted settings from the notebook model into each matching extension. Called during notebook open, after extensions are loaded.
public System.Threading.Tasks.Task RestoreSettingsAsync(Verso.Abstractions.NotebookModel notebook);
Parameters#
notebook NotebookModel
Returns#
SaveSettingsAsync(NotebookModel) Method#
Saves current settings from all extensions into the notebook model. Only persists values that differ from defaults.
public System.Threading.Tasks.Task SaveSettingsAsync(Verso.Abstractions.NotebookModel notebook);
Parameters#
notebook NotebookModel
Returns#
UpdateSettingAsync(string, string, object) Method#
Updates a single setting on the target extension and raises the change event.
public System.Threading.Tasks.Task UpdateSettingAsync(string extensionId, string settingName, object? value);
Parameters#
extensionId System.String
settingName System.String
value System.Object
Returns#
Events#
OnSettingsChanged Event#
Raised when any extension setting changes.
public event Action<string,string,object?>? OnSettingsChanged;