Specifies a given method body that implements a given method declaration.
[Visual Basic] Public Sub DefineMethodOverride( _ ByVal methodInfoBody As MethodInfo, _ ByVal methodInfoDeclaration As MethodInfo _ ) [C#] public void DefineMethodOverride( MethodInfo methodInfoBody, MethodInfo methodInfoDeclaration ); [C++] public: void DefineMethodOverride( MethodInfo* methodInfoBody, MethodInfo* methodInfoDeclaration ); [JScript] public function DefineMethodOverride( methodInfoBody : MethodInfo, methodInfoDeclaration : MethodInfo );
DefineMethodOverride defines a method impl. A method impl is a token point to an implementation and a token pointing to a declaration that the body will implement. The body must be defined on the type the method impl is defined and the body must be virtual. The declaration can be to a method defined on an interface implemented by the type, a method on a subclass or a method defined in the type. If the declaration is on an interface only the slot defined for the interface is altered. If the declaration is to a method on a base type then the slot for the method is overridden and any duplicates for the overridden method are also replaced. The method overridden may not be the actual method declared. If the method is on the same type then the slot is replaced and any duplicates for the replaced methods are overridden
TypeBuilder Class | TypeBuilder Members | System.Reflection.Emit Namespace