Presets<T>

References
[IoId("00000000-7afb-41e0-b4e1-4c489e4646ee")] public sealed class Presets<T> : IPresets
Generic implementation of IPresets.
T

Constructors

Presets

#
Empty preset constructor.
public Presets()

Presets

#
public Presets(
reader
)

Properties

AllPresets

#
Enumerate over all name+value pairs.
public IEnumerable<Preset<T>> AllPresets { get; }

Count

#
Gets the number of preset values.
public int Count { get; }
Count
Explicit

IPresets.AllPresets

#
AllPresets

Names

#
Enumerate over all names.
public IEnumerable<string> Names { get; }
Names

Indexers

Explicit

IPresets.this[]

#
IPreset IPresets.this[
index
]
this[]
Explicit

IPresets.this[]

#
this[]

this[]

#
Access a specific name+value pair.
public Preset<T> this[
index
Index of pair.
] { get; }

this[]

#
Access a specific value by name.
public Preset<T> this[
name
Name of value.
] { get; }

Methods

Add

#
Attempt to add a preset.
public bool Add(
Preset<T>
preset
Preset to add.
)
True if preset was successfully added.

Add

#
Attempt to add a preset.
public bool Add(
name,
Name of preset.
info,
Description of preset.
Color
tint,
Colour of preset.
T
value
Value of preset.
)
True if preset was successfully added.

Add

#
Attempt to add a preset.
public bool Add(
name,
Name of preset.
info,
Description of preset.
T
value
Value of preset.
)
True if preset was successfully added.

AddEnum<TE>

#
Add all values from an enum as presets. This will only work if the enum numeric base type is compatible with the T constraint. The values are added under their own name, unless they have a [UiName] attribute.
public int AddEnum<TE>()
Number of added values.

AddEnumByType

#
Add all values from an enum as presets. This will only work if the enum numeric base type is compatible with the T constraint. The values are added under their own name, unless they have a [UiName] attribute.
public int AddEnumByType(
enumType
)
Number of added values.

Clear

#
Wipe all defined presets.
public void Clear()
Clear

FindByValue

#
Attempt to find the name of a value. If the value is of the wrong type or otherwise unknown to this preset collection, null or an empty string may be returned.
public Preset<T> FindByValue(
value
)
Explicit

IPresets.FindByValue

#
IPreset IPresets.FindByValue(
value
)
FindByValue
Explicit

IPresets.TryCopyFrom

#
int IPresets.TryCopyFrom(
other
)
TryCopyFrom

IsAvailable

#
Gets whether a specific name is still available and adheres to the naming scheme.
public bool IsAvailable(
name
Name to test.
)
True if name hasn't been defined.
IsAvailable

Store

#
public void Store(
writer
)
Store

TryCopyFrom

#
Try and copy all presets from another collection.
public int TryCopyFrom(
other
)
Number of presets successfully copied.