一次性设置设置所有属性值,当然要保证属性的类型相同

foreach (PropertyInfo propertyInfo in base.GetType().GetProperties())
             {
                 if (propertyInfo.CanWrite)
                 {
                     propertyInfo.SetValue(this, tag, null);
                 }
             }

posted @ 2018-04-27 16:19  mdgoogle  阅读(221)  评论(0)    收藏  举报