示例#1
0
        public sealed override Object GetValue(Object obj)
        {
            if (ReflectionTrace.Enabled)
            {
                ReflectionTrace.FieldInfo_GetValue(this, obj);
            }

            FieldAccessor fieldAccessor = this.FieldAccessor;

            return(fieldAccessor.GetField(obj));
        }
示例#2
0
        public sealed override Object GetValue(Object obj)
        {
#if ENABLE_REFLECTION_TRACE
            if (ReflectionTrace.Enabled)
            {
                ReflectionTrace.FieldInfo_GetValue(this, obj);
            }
#endif

            FieldAccessor fieldAccessor = this.FieldAccessor;
            return(fieldAccessor.GetField(obj));
        }
示例#3
0
        public sealed override object GetValue(object obj)
        {
            FieldAccessor fieldAccessor = this.FieldAccessor;

            return(fieldAccessor.GetField(obj));
        }
示例#4
0
        /// <summary>
        /// Create a <see cref="FieldAccessor.FieldSetter"/> to <c>set</c> the value of the mapped Property
        /// through a <c>Field</c>.
        /// </summary>
        /// <param name="type">The <see cref="System.Type"/> to find the mapped Property in.</param>
        /// <param name="propertyName">The name of the mapped Property to set.</param>
        /// <returns>
        /// The <see cref="FieldAccessor.FieldSetter"/> to use to set the value of the Property on an
        /// instance of the <see cref="System.Type"/>.
        /// </returns>
        /// <exception cref="PropertyNotFoundException" >
        /// Thrown when a Field for the Property specified by the <c>propertyName</c> using the
        /// <see cref="IFieldNamingStrategy"/> could not be found in the <see cref="System.Type"/>.
        /// </exception>
        public ISetter GetSetter(System.Type type, string propertyName)
        {
            string fieldName = namingStrategy.GetFieldName(propertyName);

            return(new FieldAccessor.FieldSetter(FieldAccessor.GetField(type, fieldName), type, fieldName));
        }