示例#1
0
 public FieldAdapter(FieldInfo info)
 {
     this.Info = info;
     if (info.IsPublic)
     {
         var t = MemberHandlerGenerator.Generate(info.DeclaringType, info);
         Handler = (IMemberHandler)ClassHelper.CreateInstance(t);
     }
     else
     {
         Handler = new FieldHandler(info);
     }
 }
示例#2
0
        public PropertyAdapter(PropertyInfo info)
        {
            this.Info = info;
            var method = info.GetGetMethod();

            if (method != null && method.IsPublic)
            {
                var t = MemberHandlerGenerator.Generate(info.DeclaringType, info);
                Handler = (IMemberHandler)ClassHelper.CreateInstance(t);
            }
            else
            {
                Handler = new PropertyHandler(info);
            }
        }