Exemple #1
0
        public ParameterGen BeginIndex(Type type, string name)
        {
            ParameterGen pgen = new ParameterGen(indexParameters, indexParameters.Count + 1, type, 0, name, false);

            indexParameters.Add(pgen);
            return(pgen);
        }
Exemple #2
0
        public ParameterGen <T> BeginParameter(Type type, string name)
        {
            ParameterAttributes attrs = 0;
            bool va = false;

            switch (paramMod)
            {
            case ParamModifier.Out:
                attrs |= ParameterAttributes.Out;
                goto case ParamModifier.Ref;

            case ParamModifier.Ref:
                type = type.MakeByRefType();
                break;

            case ParamModifier.Params:
                if (!type.IsArray)
                {
                    throw new InvalidOperationException(Properties.Messages.ErrParamArrayNotArray);
                }
                va = true;
                break;
            }

            ParameterGen <T> pgen = new ParameterGen <T>(typedThis, parameters, parameters.Count + 1, type, attrs, name, va);

            parameters.Add(pgen);
            paramMod = ParamModifier.None;
            return(pgen);
        }