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

◆ CreateDelegate() [1/2]

override Delegate System.Reflection.Emit.DynamicMethod.CreateDelegate ( Type delegateType)
inlinesealedvirtual

Reimplemented from System.Reflection.MethodInfo.

Definition at line 406 of file DynamicMethod.cs.

407 {
409 {
411 IRuntimeMethodInfo methodHandle = m_methodHandle;
412 RuntimeHelpers.CompileMethod(methodHandle?.Value ?? RuntimeMethodHandleInternal.EmptyHandle);
413 GC.KeepAlive(methodHandle);
414 }
415 MulticastDelegate multicastDelegate = (MulticastDelegate)Delegate.CreateDelegateNoSecurityCheck(delegateType, null, GetMethodDescriptor());
416 multicastDelegate.StoreDynamicMethod(GetMethodInfo());
417 return multicastDelegate;
418 }
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().

Referenced by System.Text.RegularExpressions.CompiledRegexRunnerFactory.CreateInstance(), and System.Runtime.Serialization.CodeGenerator.EndMethod().