Implement a EnumBuilder/FlagsBuilder in gobject (like in C#)
Submitted by mezen
Link to original bug (#746624)
Description
Add the possibility to dynamically create a enum/flags in vala as in C#
From: https://msdn.microsoft.com/en-us/library/System.Reflection.Emit.EnumBuilder(v=vs.110).aspx
EnumBuilder eb = mb.DefineEnum("Elevation", TypeAttributes.Public, typeof(int)); // Define two members, "High" and "Low". eb.DefineLiteral("Low", 0); eb.DefineLiteral("High", 1); // Create the type and save the assembly. Type finished = eb.CreateType();
Use the new enum the normal way Elevation.Low Elevation.High