public void ModifyObjectData(int l_modify_chassis, object modify_chassis_list, bool redo_Identifier) { ///<summary> ///In this section of the code, the tire is bring modified and it is placed under the method called Execute because it is an Undoable operation ///</summary> #region Editing the Chassis object to the List of Chassis Objects Chassis chassis_list; if (redo_Identifier == false) { chassis_list = new Chassis((ChassisGUI)modify_chassis_list); } else { chassis_list = (Chassis)modify_chassis_list; } ICommand cmd = Assy_List_Chassis[l_modify_chassis]; Assy_List_Chassis[l_modify_chassis]._UndocommandsChassis.Push(cmd); chassis_list._UndocommandsChassis = Assy_List_Chassis[l_modify_chassis]._UndocommandsChassis; chassis_list._RedocommandsChassis = Assy_List_Chassis[l_modify_chassis]._RedocommandsChassis; chassis_list._ChassisName = Assy_List_Chassis[l_modify_chassis]._ChassisName; Assy_List_Chassis[l_modify_chassis] = chassis_list; Assy_List_Chassis[l_modify_chassis].ChassisDataTable = chassis_list.ChassisDataTable; Assy_List_Chassis[l_modify_chassis].ChassisID = l_modify_chassis + 1; Assy_List_Chassis[l_modify_chassis].ChassisIsModified = true; PopulateDataTable(l_modify_chassis); if (redo_Identifier == false) { _RedocommandsChassis.Clear(); } ChassisGUI.DisplayChassisItem(Assy_List_Chassis[l_modify_chassis]); Kinematics_Software_New.Chassis_ModifyInVehicle(l_modify_chassis, Assy_List_Chassis[l_modify_chassis]); #endregion }
public void Undo_ModifyObjectData(int l_unexcute, ICommand command) { ///<summary> /// This code is to undo the modification action which the user has performed /// </summary> try { #region Undoing the modification ICommand cmd = Assy_List_Chassis[l_unexcute]; Assy_List_Chassis[l_unexcute]._RedocommandsChassis.Push(cmd); Assy_List_Chassis[l_unexcute] = (Chassis)command; PopulateDataTable(l_unexcute); ChassisGUI.DisplayChassisItem(Assy_List_Chassis[l_unexcute]); Kinematics_Software_New.Chassis_ModifyInVehicle(l_unexcute, Assy_List_Chassis[l_unexcute]); #endregion } catch (Exception) { } }