Exemplo n.º 1
0
        public FieldDescription(TypeDescription typeDescription, FieldInfo fieldInfo)
            : base(typeDescription, fieldInfo)
        {
            if (fieldInfo == null)
            {
                throw new ArgumentNullException("fieldInfo");
            }

            this.fieldInfo = fieldInfo;

            GettersAndSetters.TryGetAssessors(fieldInfo, out this.getFn, out this.setFn);
        }
        public PropertyDescription(TypeDescription typeDescription, PropertyInfo propertyInfo)
            : base(typeDescription, propertyInfo)
        {
            if (propertyInfo == null)
            {
                throw new ArgumentNullException("propertyInfo");
            }

            this.propertyInfo = propertyInfo;

            this.getMethod = propertyInfo.GetGetMethod(nonPublic: true);
            this.setMethod = propertyInfo.GetSetMethod(nonPublic: true);

            GettersAndSetters.TryGetAssessors(this.getMethod, this.setMethod, out this.getFn, out this.setFn);
        }