System.Reflection.Emit.MethodBuilder.SetParameters C# (CSharp) Method

SetParameters() public method

public SetParameters ( ) : void
return void
        public void SetParameters(params System.Type[] parameterTypes) { }
        public void SetReturnType(System.Type returnType) { }

Usage Example

Example #1
0
        private Emit.MethodBuilder GenerateMethod(Emit.MethodBuilder methb, MethodDeclaration method)
        {
            this.il             = methb.GetILGenerator();
            this.symbolTable    = new Collections.Dictionary <string, Emit.LocalBuilder>();
            this.parameterTable = new System.Collections.Generic.Dictionary <string, Type>();

            //foreach (string arg in method.parameters)
            //{
            //    parameterTable[arg] = typeof(string);
            //}

            foreach (Collections.KeyValuePair <string, Type> para in method.parameters)
            {
                parameterTable[para.Key] = para.Value;
            }


            this.GenStmt(method.stmt);

            Collections.List <Type> args = new System.Collections.Generic.List <Type>();

            foreach (Collections.KeyValuePair <string, Type> para in parameterTable)
            {
                args.Add(para.Value);
            }


            //foreach(string arg in method.parameters)
            //{
            //    args.Add(typeof(string));
            //}

            methb.SetParameters(args.ToArray());
            return(methb);
        }
All Usage Examples Of System.Reflection.Emit.MethodBuilder::SetParameters