typesafe enum support for storing the enum name (for ToString)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5959 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9eeda24047
commit
ac4df70a4c
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue