System.Reflection.Emit.DynamicILGenerator.GetCallableMethod C# (CSharp) Method

GetCallableMethod() private method

private GetCallableMethod ( void module ) : RuntimeMethodHandle
module void
return System.RuntimeMethodHandle
        internal unsafe RuntimeMethodHandle GetCallableMethod(void* module) {
            return new RuntimeMethodHandle(ModuleHandle.GetDynamicMethod(
                                                module,
                                                m_methodBuilder.Name,
                                                (byte[])m_scope[m_methodSigToken], 
                                                new DynamicResolver(this)));
        }

Usage Example

Ejemplo n.º 1
0
        [System.Security.SecurityCritical]  // auto-generated
        internal unsafe RuntimeMethodHandle GetMethodDescriptor()
        {
            if (m_methodHandle == null)
            {
                lock (this) {
                    if (m_methodHandle == null)
                    {
                        if (m_DynamicILInfo != null)
                        {
                            m_DynamicILInfo.GetCallableMethod(m_module, this);
                        }
                        else
                        {
                            if (m_ilGenerator == null || m_ilGenerator.ILOffset == 0)
                            {
                                throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadEmptyMethodBody", Name));
                            }

                            m_ilGenerator.GetCallableMethod(m_module, this);
                        }
                    }
                }
            }
            return(new RuntimeMethodHandle(m_methodHandle));
        }