all groups > vj# > december 2003 >
You're in the

vj#

group:

how to extend Enum class in j#



how to extend Enum class in j# Abc
12/16/2003 1:09:03 AM
vj#: When I tried to extend Enum class in an application of j#
it was giving 'Cannot author attributes, enums or value
types' error.

Can anyone help me out with this?


Thanks
Re: how to extend Enum class in j# Bruno Jouhier [MVP]
12/16/2003 4:03:39 PM
VS2003 does not support this feature. At least two ways around it:

The Java way. As Java does not support enums, you declare them as static
final int members of a class:
public class MyEnum { public static final int MyValue1 = 1; ... }

The C# way: You declare your enums in C#, in a separate assembly and you
import the assembly from your VJ# project.

Would be so much nicer if Java had enums.

Bruno.

"Abc" <anonymous@discussions.microsoft.com> a écrit dans le message de
news:07dc01c3c3b4$403e9a40$a401280a@phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button