Enums

Feb 28, 2013 at 4:45 PM
I don't see any reference to enums in the documentation. Can I simply access an enum by the registered type name?
Coordinator
Feb 28, 2013 at 5:22 PM
Edited Aug 3, 2013 at 3:34 AM
Hi jamesnw,

Script code uses enums just like C# code uses them. Like all host types, however, enum types must be exposed to the script engine to be accessible to script code:
// C#
engine.AddHostType("StringComparison", typeof(StringComparison));
Console.WriteLine(engine.Evaluate("StringComparison.OrdinalIgnoreCase"));
Cheers!