typesafe enum support for storing the enum name (for ToString)

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5959 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-05-31 07:25:18 +00:00
commit 0517402cea

View file

@ -962,10 +962,10 @@ class CSHARP : public Language {
// Wrap (non-anonymouse) enum using the typesafe enum pattern
if (Getattr(n,"enumvalue")) {
String *value = enumValue(n);
Printf(enum_code, " public static readonly %s %s = new %s(%s);\n", return_type, symname, return_type, value);
Printf(enum_code, " public static readonly %s %s = new %s(\"%s\", %s);\n", return_type, symname, return_type, symname, value);
Delete(value);
} else {
Printf(enum_code, " public static readonly %s %s = new %s();\n", return_type, symname, return_type);
Printf(enum_code, " public static readonly %s %s = new %s(\"%s\");\n", return_type, symname, return_type, symname);
}
} else {
// Simple integer constants