Пример #1
0
        internal ReflectionProperty(PropertyInfo property, ReflectionClass parent)
        {
            this.property = property;
            this.parent = parent;

            this.attributes =
                new ReflectionAttributeList(this.property.GetCustomAttributes(true).OfType<Attribute>().ToList());
            this.name = this.property.Name;
            this.propertyType = this.property.PropertyType;

            var method = this.property.GetGetMethod() ?? this.property.GetGetMethod(true);
            if (method != null)
            {
                this.getMethod = new ReflectionMethod(method, parent);
            }

            method = this.property.GetSetMethod() ?? this.property.GetSetMethod(true);
            if (method != null)
            {
                this.setMethod = new ReflectionMethod(method, parent);
            }
        }
Пример #2
0
        internal ReflectionProperty(PropertyInfo property, ReflectionClass parent)
        {
            this.property = property;
            this.parent   = parent;

            this.attributes =
                new ReflectionAttributeList(this.property.GetCustomAttributes(true).OfType <Attribute>().ToList());
            this.name         = this.property.Name;
            this.propertyType = this.property.PropertyType;

            var method = this.property.GetGetMethod() ?? this.property.GetGetMethod(true);

            if (method != null)
            {
                this.getMethod = new ReflectionMethod(method, parent);
            }

            method = this.property.GetSetMethod() ?? this.property.GetSetMethod(true);
            if (method != null)
            {
                this.setMethod = new ReflectionMethod(method, parent);
            }
        }