CODEDOM问题
接口的MEMBER中 声明不能加public private
可是即便不指定MemberAttributes,他也会自动加PRAVATE,导致编译不过
怎样才能不加?
CodeTypeDeclaration serviceInterface = new CodeTypeDeclaration(interfaceName);
serviceInterface.IsInterface = true;
foreach (XmlNode eventNode in eventNodes)
{
serviceInterface.Members.Add(GenerateCodeMemberEvent(eventNode.Attributes[NAME].Value, true));
}
private CodeMemberEvent GenerateCodeMemberEvent(string name, bool isInterface)
{
CodeMemberEvent e = new CodeMemberEvent();
if (!isInterface)
{
e.Attributes = MemberAttributes.Public;
}
e.Name = name;
e.Type = new CodeTypeReference(typeof(System.EventHandler <OmsWorkflowEventArgs> ));
return e;
}
------解决方案--------------------对接口还不是很了解
------解决方案--------------------没弄懂,LZ可以讲清楚点不?