IVariableManager
Manages variables across actors, including persistence, loading, and change tracking.
Namespace: ControlBee.Interfaces
Extends: INotifyPropertyChanged
Properties
| Name | Type | Description |
|---|---|---|
LocalName | string | The current local (recipe) name. |
LocalNames | string[] | All available local names. |
Modified | bool | Whether any variable has unsaved changes. |
Methods
Add
Registers a variable with the manager.
void Add(IVariable variable);
Save
Saves all variables to the database.
void Save(string? localName = null);
Parameters:
localName— Optional local name to save under. Uses current if not specified.
Load
Loads all variables from the database.
void Load(string? localName = null);
Delete
Deletes all variables for the given local name.
void Delete(string localName);
ReadVariable<T>
Reads a variable value by location.
T ReadVariable<T>(string localName, string actorName, string itemPath) where T : new();
WriteVariable
Writes a variable value by location.
void WriteVariable(string localName, string actorName, string itemPath, string value);
void WriteVariable<T>(string localName, string actorName, string itemPath, T value) where T : new();
void WriteVariable(Type variableType, string localName, string actorName, string itemPath, object value);
ReadVariableChanges
Reads the history of variable changes.
DataTable ReadVariableChanges(QueryOptions? options = null);
SaveTemporaryVariables
Saves variables that have been temporarily modified.
void SaveTemporaryVariables();
DiscardChanges
Discards all unsaved variable changes.
void DiscardChanges();
Reload
Reloads all variables from the database.
void Reload();
RenameLocalName
Renames a local (recipe) name.
void RenameLocalName(string sourceLocalName, string targetLocalName);
Events
LoadCompleted
Raised when loading is complete.
event EventHandler<string>? LoadCompleted;