Class AppScoped<T>
- Namespace
- Ofs
- Assembly
- Ofs.Api.dll
A value of type T that lives in this plugin's global settings: it is loaded
once when created and saved back whenever it changes. Get it once in OnLoad()
via AppScoped<T>(string), then read and mutate Value directly
(its fields/properties bind straight into Ui widgets) — the host flushes edits once
per frame and again on app close, so there is nothing to call.
Unlike ProjectScoped<T>, this is global to all projects (it does not reset or
reload when a different project is opened); it is persisted in this plugin's own file under the
app's settings directory. T is JSON-serialized including public fields, so a
plain settings class with public fields works without attributes. Main-thread only.
public sealed class AppScoped<T> : IDisposable where T : new()
Type Parameters
T
- Inheritance
-
objectAppScoped<T>
- Implements
Properties
Value
The live value. Mutate it freely (e.g. bind its fields into widgets); the host persists changes on the next frame's flush and on app close.
public T Value { get; }
Property Value
- T