Пример #1
0
        public ILConstructorBuilder DefineConstructor(AccessModifiers modifier)
        {
            if (this._isBuild)
            {
                throw new DefinitionException("Tip daha önce derlenmiş. Derlenmiş tipler üzerinde yeni üye eklemesi yapılamaz.");
            }

            ILConstructorBuilder builder;

            switch (modifier)
            {
            case AccessModifiers.Public:
                builder = new ILConstructorBuilder(this, MethodAttributes.Public);
                break;

            case AccessModifiers.Protected:
                builder = new ILConstructorBuilder(this, MethodAttributes.Family);
                break;

            case AccessModifiers.ProtectedInternal:
                builder = new ILConstructorBuilder(this, MethodAttributes.FamORAssem);
                break;

            case AccessModifiers.Internal:
                builder = new ILConstructorBuilder(this, MethodAttributes.Assembly);
                break;

            default:     //Private
                builder = new ILConstructorBuilder(this, MethodAttributes.Private);
                break;
            }
            this._ctors.Add(builder);
            return(builder);
        }
Пример #2
0
        public ILConstructorBuilder DefineConstructor(MethodAttributes attributes, CallingConventions conventions)
        {
            if (this._isBuild)
            {
                throw new DefinitionException("Tip daha önce derlenmiş. Derlenmiş tipler üzerinde yeni üye eklemesi yapılamaz.");
            }

            ILConstructorBuilder builder = new ILConstructorBuilder(this, attributes, conventions);

            this._ctors.Add(builder);
            return(builder);
        }