日期:2014-05-17 浏览次数:21007 次
CodeTypeDeclaration myEnum = new CodeTypeDeclaration("PayMethod");
myEnum.IsEnum = true;
myEnum.Attributes = MemberAttributes.Public;
CodeMemberField codeMemberField = new CodeMemberField(typeof(int), "现结");
codeMemberField.InitExpression = new CodeSnippetExpression("1");
myEnum.Members.Add(codeMemberField);
codeMemberField = new CodeMemberField(typeof(int), "月结");
codeMemberField.InitExpression = new CodeSnippetExpression("2");
myEnum.Members.Add(codeMemberField);
codeMemberField = new CodeMemberField(typeof(int), "预付");
codeMemberField.InitExpression = new CodeSnippetExpression("2");
myEnum.Members.Add(codeMemberField);
ns.Types.Add(myEnum);