Boo.Lang.Compiler.TypeSystem.AnonymousCallablesManager.CreateEndInvokeMethod C# (CSharp) Method

CreateEndInvokeMethod() public method

public CreateEndInvokeMethod ( ICallableType anonymousType ) : Method
anonymousType ICallableType
return Boo.Lang.Compiler.Ast.Method
        public Method CreateEndInvokeMethod(ICallableType anonymousType)
        {
            CallableSignature signature = anonymousType.GetSignature();
            Method method = CodeBuilder.CreateRuntimeMethod("EndInvoke", signature.ReturnType);

            int delta = 1;
            foreach (IParameter p in signature.Parameters)
            {
                if (p.IsByRef)
                {
                    method.Parameters.Add(
                        CodeBuilder.CreateParameterDeclaration(++delta,
                                p.Name,
                                p.Type,
                                true));
                }
            }
            delta = method.Parameters.Count;
            method.Parameters.Add(
                CodeBuilder.CreateParameterDeclaration(delta + 1, "result", TypeSystemServices.Map(typeof(IAsyncResult))));
            return method;
        }