Exemplo n.º 1
0
        public EasyMethod CreateMethod(string name, MethodAttributes attrs, ReturnReferenceExpression returnType, params Type[] args)
        {
            EasyMethod method = new EasyMethod(this, name, attrs, returnType, ArgumentsUtil.ConvertToArgumentReference(args));

            this._methods.Add(method);
            return(method);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="baseConstructor"></param>
        /// <returns></returns>
        protected virtual EasyConstructor GenerateConstructor(ConstructorInfo baseConstructor)
        {
            ArrayList         list       = new ArrayList();
            ArgumentReference reference  = new ArgumentReference(base.Context.Interceptor);
            ArgumentReference reference2 = new ArgumentReference(typeof(object[]));

            list.Add(reference);
            ParameterInfo[] parameters = baseConstructor.GetParameters();
            if (base.Context.HasMixins)
            {
                list.Add(reference2);
            }
            ArgumentReference[] c = ArgumentsUtil.ConvertToArgumentReference(parameters);
            list.AddRange(c);
            EasyConstructor constructor = base.MainTypeBuilder.CreateConstructor((ArgumentReference[])list.ToArray(typeof(ArgumentReference)));

            this.GenerateConstructorCode(constructor.CodeBuilder, reference, SelfReference.Self, reference2);
            constructor.CodeBuilder.InvokeBaseConstructor(baseConstructor, c);
            constructor.CodeBuilder.AddStatement(new ReturnStatement());
            return(constructor);
        }
Exemplo n.º 3
0
        public EasyCallable CreateCallable(Type returnType, params ParameterInfo[] args)
        {
            EasyCallable nested = new EasyCallable(this, base.IncrementAndGetCounterValue, new ReturnReferenceExpression(returnType), ArgumentsUtil.ConvertToArgumentReference(args));

            base._nested.Add(nested);
            return(nested);
        }
Exemplo n.º 4
0
 public EasyMethod CreateSetMethod(MethodAttributes attrs, params Type[] parameters)
 {
     if (this._setMethod == null)
     {
         this._setMethod = new EasyMethod(this._maintype, "set_" + this._builder.Name, attrs, new ReturnReferenceExpression(typeof(void)), ArgumentsUtil.ConvertToArgumentReference(parameters));
     }
     return(this._setMethod);
 }
Exemplo n.º 5
0
 public EasyMethod CreateRemoveOnMethod(MethodAttributes atts, params Type[] parameters)
 {
     if (this.m_removeOnMethod == null)
     {
         this.m_removeOnMethod = new EasyMethod(this.m_maintype, "remove_" + this.Name, atts, new ReturnReferenceExpression(typeof(void)), ArgumentsUtil.ConvertToArgumentReference(parameters));
     }
     return(this.m_removeOnMethod);
 }