I finally found time to work on my little plugin again, and stuff went wrong again, how that always seems to happen when programming ^^'
When working with a single measure, everything seemed to go fine. I work in a child-parent relationship, where every class seems to initiate well, and the independent classes seem to update well as well. The problem arises when 2 measures with different types come around.
Code: Select all
internal class Measure
{
internal static Measure MeasureFromData(API api, IntPtr data)
{
object x = GCHandle.FromIntPtr(data).Target;
MeasureType measureType;
Enum.TryParse(api.ReadString("Type", ""), true, out measureType);
switch (measureType)
{
case MeasureType.ChildMeasure:
return (ChildMeasure)x;
case MeasureType.ParentMeasure:
return (ParentMeasure)x;
default:
return (Measure)x;
}
}
}
Any ideas out there?
Thanks!
Chilio