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

DefineParameter() public method

public DefineParameter ( int position, System attributes, string strParamName ) : System.Reflection.Emit.ParameterBuilder
position int
attributes System
strParamName string
return System.Reflection.Emit.ParameterBuilder
        public System.Reflection.Emit.ParameterBuilder DefineParameter(int position, System.Reflection.ParameterAttributes attributes, string strParamName) { throw null; }
        public override bool Equals(object obj) { throw null; }

Usage Example

Esempio n. 1
0
        public void Emit(CompilerErrorCollection errors, MethodBuilder m)
        {
            //Set the parameters
            //ParameterBuilder[] parms = new ParameterInfo[args.Length];
            for(int i = 0; i < args.Length; i++)
                m.DefineParameter(i + 1, ParameterAttributes.None, args[i].Name);

            ILGenerator gen = m.GetILGenerator();

            //Define the IT variable
            LocalRef it = locals["IT"] as LocalRef;
            DefineLocal(gen, it);

            statements.Process(this, errors, gen);

            statements.Emit(this, gen);

            //Cast the IT variable to our return type and return it
            if (m.ReturnType != typeof(void))
            {
                gen.Emit(OpCodes.Ldloc, it.Local);
                Expression.EmitCast(gen, it.Type, m.ReturnType);
            }
            gen.Emit(OpCodes.Ret);
        }
All Usage Examples Of System.Reflection.Emit.MethodBuilder::DefineParameter