I am using a property that is a List of enums with the [Flags] attribute.
When I attempt to edit the property in EditorX, the list shows up properly as do the individual check boxes for the flags, but any changes I make are not preserved.
If I replace the enum with a class containing a bool member in place of the [Flags], then it works.
Unfortunately, there are a some unrelated reasons I need to use the enum so was hoping there is some workaround.
Example snipped from my plugin step:
This is the definition of the enums
public class ProbeRailInstrument : Instrument
{
[Flags]
public enum AnalogChannel
{
[Display("V1")]
V1 = 1,
[Display("V2")]
V2 = 2,
[Display("I")]
I = 4,
[Display("C")]
C = 8,
}
[Flags]
public enum EventChannel
{
[Display("E+")]
E = 1,
[Display("E-")]
C = 2,
}
...
These are the properties in my test step
[Display("Analogs", Group:"Channels", Order:5.1)]
[EnabledIf(nameof(ControlMethod), ControlSetting.Independent, HideIfDisabled = true)]
public List<ProbeRailInstrument.AnalogChannel> Analogs{get; set;}
[Display("Events", Group:"Channels", Order:5.2)]
[EnabledIf(nameof(ControlMethod), ControlSetting.Independent, HideIfDisabled = true)]
public List<ProbeRailInstrument.EventChannel> Events{get; set;}
Since they show up correctly, I think everything above is OK. Also, I use a similar enum outside of a List and the property can be edited successfully.
I also changed from a List to an Array but still no difference so the problem seems to be with the enums.
If I manually edit the test plan, everything works as expected, and the manually edited values show up in the list editor in EditorX. I just cant make any changes within EditorX and have the changes preserved once the List editor is closed.
Thanks for any input,
Wittrock