Ejemplo n.º 1
0
        public override ILProperty GetProperty(string propertyName)
        {
            if (((IBuilder)this.Coding).IsBuild)
            {
                throw new CodingException("Metodun tanımlandığı tip derlenmiş. Derlenmiş metotların gövdesi yeniden yazılamaz.");
            }
            if (propertyName == null)
            {
                throw new ArgumentNullException("propertyName");
            }

            Type         baseType = this.Coding.CurrentMethod.ILTypeBuilder.BaseType;
            ILProperty   ilProp   = null;
            PropertyInfo property = baseType.GetProperty(propertyName);

            if (property == null || (ilProp = new ILProperty(this.Coding, this, property)).IsStatic)
            {
                throw new MemberNotFoundException("Hedef obje, çağrılmak istenen özelliği içermiyor veya özellik statik.");
            }

            if (ilProp.GetModifier == AccessModifiers.Private)
            {
                throw new MemberAccessException("Özellik, private olarak tanımlanmış. Özelliğe erişilemiyor.");
            }
            else
            {
                return(ilProp);
            }
        }
Ejemplo n.º 2
0
        public virtual ILProperty GetProperty(string propertyName)
        {
            if (((IBuilder)this.Coding).IsBuild)
            {
                throw new CodingException("Metodun tanımlandığı tip derlenmiş. Derlenmiş metotların gövdesi yeniden yazılamaz.");
            }
            if (propertyName == null)
            {
                throw new ArgumentNullException("propertyName");
            }

            ILProperty ilProp = null;

            if (this.ILType.IsGenericParameter)
            {
                throw new CodingException("Değişkenin türü bir generic parametre türündeydi. Generic parametreler üzerinden üye çağırmak için ILVariable.Constrain(Type) metodu kullanılmalıdır.");
            }

            PropertyInfo property = this.ILType.GetProperty(propertyName);

            if (property == null || (ilProp = new ILProperty(this.Coding, this, property)).IsStatic)
            {
                throw new MemberNotFoundException("Hedef obje, çağrılmak istenen özelliği içermiyor veya özellik statik.");
            }
            else
            {
                return(ilProp);
            }
        }
Ejemplo n.º 3
0
        internal ILForeach(ILCoder coding, ILVariable enumerable)
            : base(coding)
        {
            this._current     = coding.Null.ToLocal();
            this._enumerator  = enumerable.Invoke(ILForeach.getEnumerator, null, null).ToLocal();
            this._currentProp = this._enumerator.GetProperty("Current");
            this._moveNext    = this._enumerator.Invoke(ILForeach.moveNext, null, null);

            this._innerWhile = coding.While(this._moveNext);
            this.Item.AssignFrom(this._currentProp.Get());
        }