Class PresetList
- Namespace
- PluginUI
- Assembly
- PluginUI.dll
In-memory IPresetProvider: the application supplies the load/capture callbacks (Loading, Capture) and persists Entries as it likes.
public sealed class PresetList : IPresetProvider
- Inheritance
-
PresetList
- Implements
- Inherited Members
Constructors
PresetList()
Creates an empty list.
public PresetList()
PresetList(IEnumerable<PresetEntry>)
Creates a list from entries.
public PresetList(IEnumerable<PresetEntry> entries)
Parameters
entriesIEnumerable<PresetEntry>
Properties
CanSave
true if Save(string) is supported.
public bool CanSave { get; }
Property Value
Capture
Called to capture the current state when saving (returns the payload).
[Browsable(false)]
public Func<object?>? Capture { get; set; }
Property Value
Count
Number of presets.
public int Count { get; }
Property Value
CurrentIndex
Index of the loaded preset (−1 = none).
public int CurrentIndex { get; }
Property Value
Entries
Entries.
public IReadOnlyList<PresetEntry> Entries { get; }
Property Value
IsModified
true if parameters changed since the preset was loaded.
public bool IsModified { get; }
Property Value
Loading
Called to apply a preset (index, entry).
[Browsable(false)]
public Action<int, PresetEntry>? Loading { get; set; }
Property Value
UserBank
Bank assigned to presets saved by the user.
public string? UserBank { get; set; }
Property Value
Methods
Add(PresetEntry)
Adds an entry.
public void Add(PresetEntry entry)
Parameters
entryPresetEntry
CanDelete(int)
true if the preset can be deleted (user presets).
public bool CanDelete(int index)
Parameters
indexint
Returns
Delete(int)
Deletes a preset.
public void Delete(int index)
Parameters
indexint
GetBank(int)
Bank / category of a preset (null = no grouping).
public string? GetBank(int index)
Parameters
indexint
Returns
GetName(int)
Name of a preset.
public string GetName(int index)
Parameters
indexint
Returns
Load(int)
Loads a preset.
public void Load(int index)
Parameters
indexint
MarkModified()
Marks the current preset as modified (call when a parameter changes).
public void MarkModified()
Save(string)
Saves the current state under name (overwrites a preset with the same name); returns its index.
public int Save(string name)
Parameters
namestring
Returns
Events
Changed
Raised when the list, the current index or the modified flag changes.
public event Action<IPresetProvider>? Changed