Пример #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);
        }
Пример #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);
        }
Пример #3
0
 internal SignatureGen(Type returnType)
 {
     typedThis = (T)this;
     if (returnType != null)
     {
         this.returnParameter = new ParameterGen(parameters, 0, returnType, 0, null, false);
     }
 }
Пример #4
0
 internal SignatureGen(Type returnType, ITypeMapper typeMapper)
     : base(typeMapper)
 {
     _parameters = new ParameterGenCollection(typeMapper);
     TypedThis   = (T)this;
     if (returnType != null)
     {
         ReturnParameter = new ParameterGen(_parameters, 0, returnType, 0, null, false);
     }
 }
Пример #5
0
        public Operand Arg(string name)
        {
            ParameterGen param = context.GetParameterByName(name);

            return(new _Arg(_ThisOffset + param.Position - 1, param.Type));
        }
Пример #6
0
        public ContextualOperand Arg(string name)
        {
            ParameterGen param = Context.GetParameterByName(name);

            return(new ContextualOperand(new _Arg(ThisOffset + param.Position - 1, param.Type), TypeMapper));
        }