예제 #1
0
        public FieldDescription(TypeDescription typeDescription, FieldInfo fieldInfo)
            : base(typeDescription, fieldInfo)
        {
            if (fieldInfo == null)
            {
                throw new ArgumentNullException("fieldInfo");
            }

            this.fieldInfo = fieldInfo;

            MetadataReflection.TryGetMemberAccessFunc(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);

            MetadataReflection.TryGetMemberAccessFunc(this.getMethod, this.setMethod, out this.getFn, out this.setFn);
        }