[Ikvm-developers] Enumerations with the FlagsAttribute set
Brought to you by:
jfrijters
From: Michael K. <mi...@sa...> - 2006-01-30 01:11:57
|
I'm trying to call (from Java) one of the .NET System.Globalization.CompareInfo.Compare() methods that takes an argument of type CompareOptions. I can't see how to set up a CompareOptions instance to supply. This is an enumeration type with the FlagsAttribute set, and it seems from the examples that in C# it's done by creating an int with the right bits set, and then casting it to a CompareOptions. In Java, of course, no such cast is possible. At present the only way I can see of doing it is to create a wrapper class in C# that takes arguments of type int rather than CompareOptions. Is there a better way? Michael Kay http://www.saxonica.com/ |