Hi, In VS2003, J# didn't support writing enums though it supported consuming them :(. AS an workaround,
1. You can expose a set of named constants as public, static, fields and then consume them but in this case you may have to change your java code here and there. For Example...
class Status {
public static final int CONTINUE = 1;
public static final int WON = 2;
public static final int LOST = 3;
}
2. you can declare the enum in a C# class library project, refer the dll in J# project and compile it. It must work fine without changing the java code much.
For example you can following code in C# Class library project...
using
System; namespace <Packagename> { enum Status { CONTINUE, WON, LOST }; }
Compile it and refer the dll in J# .
Please let us know if you face any issues in implementing these workarounds.
Enum Problem
CFleming
oky
Did you see any problem with above code in VJ#
Tyler Whitney-MSFT
Hi,
In Visual Studio 2005 (.net framework v2.0), your enum code must compile as it is.
PLease refer this link for more on enums in J#.
Thanks.
Paul B.
Hi,
In VS2003, J# didn't support writing enums though it supported consuming them :(.
AS an workaround,
1. You can expose a set of named constants as public, static, fields and then consume them but in this case you may have to change your java code here and there. For Example...
class Status {
public static final int CONTINUE = 1;
public static final int WON = 2;
public static final int LOST = 3;
}
2. you can declare the enum in a C# class library project, refer the dll in J# project and compile it. It must work fine without changing the java code much.
For example you can following code in C# Class library project...
using
System;namespace <Packagename>
{
enum Status { CONTINUE, WON, LOST };
}
Compile it and refer the dll in J# .
Please let us know if you face any issues in implementing these workarounds.
Thanks.