public void ModifyObjectData(int l_modify_wa, object modify_wa_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 Wheel Alignment Object WheelAlignment wa_list; if (redo_Identifier == false) { wa_list = new WheelAlignment((WheelAlignmentGUI)modify_wa_list); } else { wa_list = (WheelAlignment)modify_wa_list; } ICommand cmd = Assy_List_WA[l_modify_wa]; Assy_List_WA[l_modify_wa]._UndocommandsWheelAlignment.Push(cmd); wa_list._UndocommandsWheelAlignment = Assy_List_WA[l_modify_wa]._UndocommandsWheelAlignment; wa_list._RedocommandsWheelAlignment = Assy_List_WA[l_modify_wa]._RedocommandsWheelAlignment; wa_list._WAName = Assy_List_WA[l_modify_wa]._WAName; Assy_List_WA[l_modify_wa] = wa_list; Assy_List_WA[l_modify_wa].WADataTable = wa_list.WADataTable; Assy_List_WA[l_modify_wa].WheelAlignmentID = l_modify_wa + 1; Assy_List_WA[l_modify_wa].WheelAlignmentIsModified = true; PopulateDataTable(l_modify_wa); if (redo_Identifier == false) { _RedocommandsWheelAlignment.Clear(); } WheelAlignmentGUI.DisplayWheelAlignmentItem(Assy_List_WA[l_modify_wa]); Kinematics_Software_New.WA_ModifyInVehicle(l_modify_wa, Assy_List_WA[l_modify_wa]); #endregion }
public void Undo_ModifyObjectData(int l_unexcute_wa, ICommand command) { ///<summary> /// This code is to undo the modification action which the user has performed /// </summary> try { #region Undo the wheel alignment modification ICommand cmd = Assy_List_WA[l_unexcute_wa]; Assy_List_WA[l_unexcute_wa]._RedocommandsWheelAlignment.Push(cmd); Assy_List_WA[l_unexcute_wa] = (WheelAlignment)command; PopulateDataTable(l_unexcute_wa); WheelAlignmentGUI.DisplayWheelAlignmentItem(Assy_List_WA[l_unexcute_wa]); Kinematics_Software_New.WA_ModifyInVehicle(l_unexcute_wa, Assy_List_WA[l_unexcute_wa]); #endregion } catch (Exception) { } }