Ejemplo n.º 1
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        #region IAnonymousMethodOperand Members

        public void CreateAnonymousMethod(ClassType ownerClass, ClosureDefinition closure, bool isStatic, bool isPublic)
        {
            Debug.Assert(m_Method == null, "CreateAnonymousMethod was already called.");

            var methodFactory = new AnonymousMethodFactory(
                ownerClass,
                hostMethod: m_HomeScopeBlock.OwnerMethod,
                argumentTypes: m_Signature.ArgumentType,
                returnType: m_Signature.ReturnType,
                isStatic: isStatic,
                isPublic: isPublic);

            m_Method = new MethodMember(ownerClass, methodFactory, closure);
            m_Method.SetBody(m_Statements);
            ownerClass.AddMember(m_Method);

            m_Signature = m_Method.Signature;

            var operandBinder = new BindToMethodOperandVisitor(m_Method);

            m_Method.AcceptVisitor(operandBinder);
        }