コード例 #1
0
        public EasyRuntimeMethod(AbstractEasyType maintype, string name, ReturnReferenceExpression returnRef, ArgumentReference[] arguments)
        {
            MethodAttributes attributes = MethodAttributes.HideBySig | MethodAttributes.Virtual | MethodAttributes.Public;

            Type[] parameterTypes = ArgumentsUtil.InitializeAndConvert(arguments);
            base._builder = maintype.TypeBuilder.DefineMethod(name, attributes, returnRef.Type, parameterTypes);
            base._builder.SetImplementationFlags(MethodImplAttributes.CodeTypeMask);
        }
コード例 #2
0
        internal EasyMethod(AbstractEasyType maintype, string name, MethodAttributes attrs, ReturnReferenceExpression returnRef, params ArgumentReference[] arguments)
        {
            this._maintype  = maintype;
            this._arguments = arguments;
            Type returnType = returnRef.Type;

            Type[] parameterTypes = ArgumentsUtil.InitializeAndConvert(arguments);
            this._builder = maintype.TypeBuilder.DefineMethod(name, attrs, returnType, parameterTypes);
        }
コード例 #3
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)
 {
     this._id         = id;
     this._args       = args;
     this._returnType = returnType;
     this.GenerateConstructor();
     this.GenerateInvoke();
     this.GenerateCallableImplementation();
 }
コード例 #4
0
ファイル: EasyConstructor.cs プロジェクト: WangWeight/Protein
 internal EasyConstructor(AbstractEasyType maintype, params ArgumentReference[] arguments)
 {
     this._maintype = maintype;
     Type[] parameterTypes = ArgumentsUtil.InitializeAndConvert(arguments);
     this._builder = maintype.TypeBuilder.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, parameterTypes);
 }
コード例 #5
0
ファイル: EasyNested.cs プロジェクト: WangWeight/Protein
 public EasyNested(AbstractEasyType maintype, string name, Type baseType, Type[] interfaces, ReturnReferenceExpression returnType, params ArgumentReference[] args)
 {
     base._typebuilder = maintype.TypeBuilder.DefineNestedType(name, TypeAttributes.Sealed | TypeAttributes.NestedPublic, baseType, interfaces);
 }
コード例 #6
0
 internal EasyMethod(AbstractEasyType maintype, string name, ReturnReferenceExpression returnRef, params ArgumentReference[] arguments) : this(maintype, name, MethodAttributes.HideBySig | MethodAttributes.Virtual | MethodAttributes.Public, returnRef, arguments)
 {
 }
コード例 #7
0
 public EasyRuntimeConstructor(AbstractEasyType maintype, params ArgumentReference[] arguments)
 {
     Type[] parameterTypes = ArgumentsUtil.InitializeAndConvert(arguments);
     base._builder = maintype.TypeBuilder.DefineConstructor(MethodAttributes.SpecialName | MethodAttributes.HideBySig | MethodAttributes.Public, CallingConventions.Standard, parameterTypes);
     base._builder.SetImplementationFlags(MethodImplAttributes.CodeTypeMask);
 }
コード例 #8
0
ファイル: EasyProperty.cs プロジェクト: WangWeight/Protein
 public EasyProperty(AbstractEasyType maintype, string name, Type returnType)
 {
     this._maintype = maintype;
     this._builder  = maintype.TypeBuilder.DefineProperty(name, PropertyAttributes.None, returnType, new Type[0]);
 }
コード例 #9
0
 internal EasyDefaultConstructor(AbstractEasyType maintype)
 {
     maintype.TypeBuilder.DefineDefaultConstructor(MethodAttributes.Public);
 }
コード例 #10
0
ファイル: EasyEvent.cs プロジェクト: WangWeight/Protein
 public EasyEvent(AbstractEasyType maintype, string name, Type eventHandlerType)
 {
     this.m_name     = name;
     this.m_maintype = maintype;
     this.m_builder  = maintype.TypeBuilder.DefineEvent(name, EventAttributes.None, eventHandlerType);
 }