public EasyEvent(AbstractEasyType maintype, String name, Type eventHandlerType)
 {
     m_name     = name;
     m_maintype = maintype;
     m_builder  = maintype.TypeBuilder.DefineEvent(
         name, EventAttributes.None, eventHandlerType);
 }
示例#2
0
 internal EasyMethod(AbstractEasyType maintype, String name,
                     ReturnReferenceExpression returnRef, params ArgumentReference[] arguments) :
     this(maintype, name,
          MethodAttributes.HideBySig | MethodAttributes.Virtual | MethodAttributes.Public,
          returnRef, arguments)
 {
 }
        internal EasyConstructor(AbstractEasyType maintype, params ArgumentReference[] arguments)
        {
            _maintype = maintype;

            Type[] args = ArgumentsUtil.InitializeAndConvert(arguments);

            _builder = maintype.TypeBuilder.DefineConstructor(
                MethodAttributes.Public, CallingConventions.Standard, args);
        }
 public EasyNested(AbstractEasyType maintype,
                   String name,
                   Type baseType, Type[] interfaces,
                   ReturnReferenceExpression returnType,
                   params ArgumentReference[] args)
 {
     _typebuilder = maintype.TypeBuilder.DefineNestedType(
         name,
         TypeAttributes.Sealed | TypeAttributes.NestedPublic | TypeAttributes.Class,
         baseType, interfaces);
 }
示例#5
0
        public EasyRuntimeConstructor(AbstractEasyType maintype, params ArgumentReference[] arguments)
        {
            Type[] args = ArgumentsUtil.InitializeAndConvert(arguments);

            _builder = maintype.TypeBuilder.DefineConstructor(
                MethodAttributes.SpecialName | MethodAttributes.Public | MethodAttributes.HideBySig,
                CallingConventions.Standard,
                args);

            _builder.SetImplementationFlags(MethodImplAttributes.Runtime | MethodImplAttributes.Managed);
        }
        public EasyRuntimeMethod(AbstractEasyType maintype, string name,
                                 ReturnReferenceExpression returnRef, ArgumentReference[] arguments)
        {
            MethodAttributes atts = MethodAttributes.HideBySig | MethodAttributes.Public | MethodAttributes.Virtual;

            Type[] args = ArgumentsUtil.InitializeAndConvert(arguments);

            _builder = maintype.TypeBuilder.DefineMethod(
                name, atts, returnRef.Type, args);
            _builder.SetImplementationFlags(
                MethodImplAttributes.Runtime | MethodImplAttributes.Managed);
        }
示例#7
0
        internal EasyMethod(AbstractEasyType maintype, String name,
                            MethodAttributes attrs,
                            ReturnReferenceExpression returnRef, params ArgumentReference[] arguments)
        {
            _maintype  = maintype;
            _arguments = arguments;

            Type returnType = returnRef.Type;

            Type[] args = ArgumentsUtil.InitializeAndConvert(arguments);

            _builder = maintype.TypeBuilder.DefineMethod(name, attrs,
                                                         returnType, args);
        }
示例#8
0
        public EasyCallable(AbstractEasyType type,
                            int id,
                            ReturnReferenceExpression returnType,
                            params ArgumentReference[] args) :
            base(type,
                 String.Format("__delegate_{0}", id),
                 typeof(MulticastDelegate),
                 new Type[] { typeof(ICallable) }, returnType, args)
        {
            _id         = id;
            _args       = args;
            _returnType = returnType;

            GenerateConstructor();
            GenerateInvoke();
            GenerateCallableImplementation();
        }
 public EasyProperty(AbstractEasyType maintype, String name, Type returnType)
 {
     _maintype = maintype;
     _builder  = maintype.TypeBuilder.DefineProperty(
         name, PropertyAttributes.None, returnType, new Type[0]);
 }
示例#10
0
 internal EasyDefaultConstructor(AbstractEasyType maintype) : base()
 {
     maintype.TypeBuilder.DefineDefaultConstructor(MethodAttributes.Public);
 }