Configure enumeration property types.
- See also
- PropertyTypeLibrary.CreateCustomEnumProperty(string, string, string, Dictionary<string, int>)
Examples
To create a property type of the enumeration data type and access its enumeration options:
public void Execute(PluginCommandParameter parameter)
{
var propertyTypesLibrary = studio.ActiveProject.PropertyTypeLibrary;
var options = new Dictionary<string, int>();
for (int i = 0; i <= 4; i++)
{
options.Add("Level" + i, i);
}
var myCustomEnumProperty = propertyTypesLibrary.CreateCustomEnumProperty(
propertyTypesLibrary.GenerateUniqueChildName("MyPlugin.MyEnumProperty"),
"My Enum Property",
"My Plugin Properties",
options);
myCustomEnumProperty.Options.Add("Level5", 5);
studio.Log(myCustomEnumProperty.Name + " has these enumeration options:");
foreach (KeyValuePair<string, int> kvp in myCustomEnumProperty.Options)
{
studio.Log(kvp.Key + "\t" + kvp.Value);
}
}