public void LoadIntoOS(object os_obj) { OS os = (OS)os_obj; FieldInfo[] fields1 = this.GetType().GetFields(); FieldInfo[] fields2 = os.GetType().GetFields(); for (int index1 = 0; index1 < fields2.Length; ++index1) { for (int index2 = 0; index2 < fields1.Length; ++index2) { if (fields2[index1].Name == fields1[index2].Name) { fields2[index1].SetValue((object)os, fields1[index2].GetValue((object)this)); } } } }