public void CopyFrom(SystemParams target) { Type targetType = target.GetType(); var targetInfos = targetType.GetFields(); Type thisType = this.GetType(); var thisInfos = thisType.GetFields(); for (int i = 0; i < thisInfos.Length; i++) { object v = Convert.ChangeType(targetInfos[i].GetValue(target), thisInfos[i].FieldType); thisInfos[i].SetValue(this, v); } }