/// <summary>
 /// 获取字段值
 /// </summary>
 /// <param name="target">拥有该成员的类实例</param>
 /// <returns></returns>
 private object Get(object target)
 {
     if (_getter == null)
     {
         _getter = FieldAccessor.InitializeGetter(this.Member);
     }
     return(_getter(target));
 }
 /// <summary>
 /// 设置字段值
 /// </summary>
 /// <param name="target">拥有该成员的类实例</param>
 /// <param name="value">字段/属性值</param>
 private void Set(object target, object value)
 {
     if (_setter == null)
     {
         _setter = FieldAccessor.InitializeSetter(this.Member);
     }
     value = value ?? TypeUtils.GetNullValue(this.Member.FieldType);
     _setter(target, value);
 }
        /// <summary>
        /// 创建成员反射器
        /// </summary>
        /// <param name="member">元数据</param>
        /// <returns></returns>
        public static MemberAccessorBase Create(MemberInfo member)
        {
            MemberAccessorBase m = null;

            if (member.MemberType == MemberTypes.Property)
            {
                m = new PropertyAccessor((PropertyInfo)member);
            }
            else if (member.MemberType == MemberTypes.Field)
            {
                m = new FieldAccessor((FieldInfo)member);
            }
            else if (member.MemberType == MemberTypes.Method)
            {
                m = new MethodAccessor((MethodInfo)member);
            }

            if (m == null)
            {
                throw new XFrameworkException("{0}.{1} not supported", member.ReflectedType, member.Name);
            }
            return(m);
        }