コード例 #1
0
 public PublicMemberInfo(FieldInfo info)
 {
     this._fieldInfo = info;
     this.type       = this._fieldInfo.FieldType;
     this.name       = this._fieldInfo.Name;
     this.attributes = PublicMemberInfo.getAttributes(this._fieldInfo.GetCustomAttributes(false));
 }
コード例 #2
0
 public PublicMemberInfo(PropertyInfo info)
 {
     this._propertyInfo = info;
     this.type          = this._propertyInfo.PropertyType;
     this.name          = this._propertyInfo.Name;
     this.attributes    = PublicMemberInfo.getAttributes(this._propertyInfo.GetCustomAttributes(false));
 }
コード例 #3
0
        public static void CopyPublicMemberValues(this object source, object target)
        {
            List <PublicMemberInfo> publicMemberInfos = source.GetType().GetPublicMemberInfos();

            for (int index = 0; index < publicMemberInfos.Count; ++index)
            {
                PublicMemberInfo publicMemberInfo = publicMemberInfos[index];
                publicMemberInfo.SetValue(target, publicMemberInfo.GetValue(source));
            }
        }