xojo.Introspection.EnumInfo is private?

It would be really really really helpful to be able to serialize and work with Enum’s.
But whenever I try to use the EnumInfo class it is private and I get a warning. Is it private by mistake? This is such a fundamental framework issue I can’t believe isn’t properly addressed.

  1. I want to be able to serialize and deserialize classes but the lack of enum support is preventing a complete and robust solution.
  2. I would like to add some methods to:
    a) return a string list of the enum options (for displaying in listbox for instance)
    b) convert a string into its enum
    c) convert an int value into its enum
    d) convert an enum into its int value
    e) convert an enum into its string value
    f) convert an enum string into its int value
    g) convert an enum int into its string value
    ^all in a generic way instead of constantly having to create and update helper methods to do this for every single enum type.


The EnumInfo class is an internal implementation detail that literally just says that a type in a function signature or property is an enumeration. There is no runtime metadata for enumerations.

I can’t seem to find an IDE Script way to auto-generate some helper methods. Do you know if this would be possible? I’m trying to record a script to help figure it out but the recorder only gives me the command

SelectWindow "XojoScriptEditor"

I do see there’s a:

DoCommand ("NewEnum")

But I want to loop through an existing enums values and generate a method based on what I find.