public void Undo_ModifyObjectData(int l_unexecute_tire, ICommand command) { ///<summary> /// This code is to undo the modification action which the user has performed /// </summary> try { #region Undo the tire modification ICommand cmd = Assy_List_Tire[l_unexecute_tire]; Assy_List_Tire[l_unexecute_tire]._RedocommandsTire.Push(cmd); Assy_List_Tire[l_unexecute_tire] = (Tire)command; PopulateDataTable(l_unexecute_tire); TireGUI.DisplayTireItem(Assy_List_Tire[l_unexecute_tire]); Kinematics_Software_New.Tire_ModifyInVehicle(l_unexecute_tire, Assy_List_Tire[l_unexecute_tire]); #endregion } catch (Exception) { } }
public void ModifyObjectData(int l_execute_tire, Object execute_tire_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 Tire object to the List of Tire objects Tire tire_list; if (redo_Identifier == false) { tire_list = new Tire((TireGUI)execute_tire_list); } else { tire_list = (Tire)execute_tire_list; } ICommand cmd = Assy_List_Tire[l_execute_tire]; Assy_List_Tire[l_execute_tire]._UndocommandsTire.Push(cmd); tire_list._UndocommandsTire = Assy_List_Tire[l_execute_tire]._UndocommandsTire; tire_list._RedocommandsTire = Assy_List_Tire[l_execute_tire]._RedocommandsTire; tire_list._TireName = Assy_List_Tire[l_execute_tire]._TireName; Assy_List_Tire[l_execute_tire] = tire_list; Assy_List_Tire[l_execute_tire].TireDataTable = tire_list.TireDataTable; //Assy_List_Tire[l_execute_tire]._TireName = "Tire " + Convert.ToString(l_execute_tire + 1); Assy_List_Tire[l_execute_tire].TireID = l_execute_tire + 1; Assy_List_Tire[l_execute_tire].TireIsModified = true; PopulateDataTable(l_execute_tire); #endregion if (redo_Identifier == false) { _RedocommandsTire.Clear(); } TireGUI.DisplayTireItem(Assy_List_Tire[l_execute_tire]); Kinematics_Software_New.Tire_ModifyInVehicle(l_execute_tire, Assy_List_Tire[l_execute_tire]); }