Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreateDelegate() [2/2]

override Delegate System.Reflection.Emit.DynamicMethod.CreateDelegate ( Type delegateType,
object? target )
inlinesealedvirtual

Reimplemented from System.Reflection.MethodInfo.

Definition at line 420 of file DynamicMethod.cs.

421 {
423 {
425 IRuntimeMethodInfo methodHandle = m_methodHandle;
426 RuntimeHelpers.CompileMethod(methodHandle?.Value ?? RuntimeMethodHandleInternal.EmptyHandle);
427 GC.KeepAlive(methodHandle);
428 }
429 MulticastDelegate multicastDelegate = (MulticastDelegate)Delegate.CreateDelegateNoSecurityCheck(delegateType, target, GetMethodDescriptor());
430 multicastDelegate.StoreDynamicMethod(GetMethodInfo());
431 return multicastDelegate;
432 }
RuntimeMethodHandle GetMethodDescriptor()
static void CompileMethod(RuntimeMethodHandleInternal method)

References System.Runtime.CompilerServices.RuntimeHelpers.CompileMethod(), System.Delegate.CreateDelegateNoSecurityCheck(), System.RuntimeMethodHandleInternal.EmptyHandle, System.Reflection.Emit.DynamicMethod.GetMethodDescriptor(), System.Reflection.Emit.DynamicMethod.GetMethodInfo(), System.GC.KeepAlive(), System.Reflection.Emit.DynamicMethod.m_methodHandle, System.Reflection.Emit.DynamicMethod.m_restrictedSkipVisibility, and System.MulticastDelegate.StoreDynamicMethod().