[英]How to Create a Method with 'new' keyword in its method signature using codedom
我想使用codedom在其方法签名中动态生成带有'new'关键字的方法。 想产生这样的东西
private new void MyMethod()
{
}
就像是:
CodeMemberMethod myMethodMethod = new CodeMemberMethod();
myMethodMethod.Attributes = MemberAttributes.Private | MemberAttributes.New;
myMethodMethod.Name = "MyMethod";
它是MemberAttributes
: MemberAttributes.New
。
调用TypeBuilder.DefineMethod
,只需包含MethodAttributes.NewSlot
:
指示该方法总是在vtable中获得一个新的插槽。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.