Name

MethodRental

Synopsis

This class can be used to swap a method “body” (the MSIL code inside the method). To do this, use the shared SwapMethodBody() method and specify the target Type, the token of the method that should receive the new body, a pointer to the new method, the size of the new method, and a flag specifying the type of compilation using the appropriate field constant (either JitImmediate or JitOnDemand). The IntPtr to the new method body should point to an array of bytes that contain the IL for the method’s header and body.

Public NotInheritable Class MethodRental
                  ' Public Shared Fields
   Public const JitImmediate As Integer                          // =1
   Public const JitOnDemand As Integer                           // =0
                  ' Public Shared Methods
   Public Shared Sub SwapMethodBody(ByVal cls As Type, 
        ByVal methodtoken As Integer, ByVal rgIL As IntPtr, 
        ByVal methodSize As Integer, 
        ByVal flags As Integer) 
End Class

Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.