DynamicMethodExtensionsGetIlAsByteArray Method
Returns the MSIL for the method body of the source
DynamicMethod, as an array of bytes.
This is the necessary equivalent for
GetILAsByteArray function,
because
GetILAsByteArray will not work with the method body returned by
an
GetMethodBody function since the IL code is stored in
the MethodBuilder's ILGenerator.
Namespace: DevCase.Extensions.DynamicMethodExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static byte[] GetIlAsByteArray(
this DynamicMethod dynMethod
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function GetIlAsByteArray (
dynMethod As DynamicMethod
) As Byte()
Dim dynMethod As DynamicMethod
Dim returnValue As Byte()
returnValue = dynMethod.GetIlAsByteArray()
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static array<unsigned char>^ GetIlAsByteArray(
DynamicMethod^ dynMethod
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member GetIlAsByteArray :
dynMethod : DynamicMethod -> byte[]
No code example is currently available or this language may not be supported.
- dynMethod DynamicMethod
-
The source DynamicMethod.
Byte
The MSIL for the method body of the source
DynamicMethod, as an array of bytes.
In Visual Basic and C#, you can call this method as an instance method on any object of type
DynamicMethod. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This is a code example #1.
No code example is currently available or this language may not be supported.
Dim dynMethod As New DynamicMethod("my_dynamic_method_name", Nothing, Type.EmptyTypes, restrictedSkipVisibility:=True)
Dim ilGen As ILGenerator = dynMethod.GetILGenerator(streamSize:=64)
ilGen.Emit(OpCodes.Nop)
Dim ilCode As Byte() = GetIlAsByteArray(dynMethod)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.