public void Undo_ModifyObjectData(int l_unexcute_scrr, ICommand command) { ///<summary> /// This code is to undo the modification action which the user has performed /// </summary> #region Undoing the modification try { SuspensionCoordinatesRearRight _scrr_forUndo = (SuspensionCoordinatesRearRight)command; ICommand cmd = Assy_List_SCRR[l_unexcute_scrr]; Assy_List_SCRR[l_unexcute_scrr]._RedocommandsSCRR.Push(cmd); Assy_List_SCRR[l_unexcute_scrr] = _scrr_forUndo; PopulateDataTable(l_unexcute_scrr); SuspensionCoordinatesRearRightGUI.DisplaySCRRItem(Assy_List_SCRR[l_unexcute_scrr]); #region Calling Undo method for Opposite Suspension if symmetric if (Assy_List_SCRR[l_unexcute_scrr].RearSymmetry == true && IsUndoRedoCalledByLeft == false) { SuspensionCoordinatesRear.IsUndoRedoCalledByRight_IdentifierMethod(true);// This method sets the IsUndoRedoCalledByRight variable to true and prevents an infinte loop UndoRedo undoRedo = new UndoRedo(); undoRedo.Identifier(SuspensionCoordinatesRear.Assy_List_SCRL[l_unexcute_scrr]._UndocommandsSCRL, SuspensionCoordinatesRear.Assy_List_SCRL[l_unexcute_scrr]._RedocommandsSCRL, l_unexcute_scrr + 1, SuspensionCoordinatesRear.Assy_List_SCRL[l_unexcute_scrr].SCRLIsModified); undoRedo.Undo(1); SuspensionCoordinatesRear.IsUndoRedoCalledByRight_IdentifierMethod(false);// This method sets the IsUndoRedoCalledByRight variable to false and allows the left suspenson coordinate to be undone } #endregion Kinematics_Software_New.EditRearCAD(l_unexcute_scrr); Kinematics_Software_New.SCRR_ModifyInVehicle(l_unexcute_scrr, Assy_List_SCRR[l_unexcute_scrr]); } catch (Exception) { } #endregion }
public void ModifyObjectData(int l_modify_scrr, object modify_scrr_list, bool redo_Identifier) { ///<summary> ///In this section of the code, the Suspension is bring modified and it is placed under the method called ModifyObjectData because it is an Undoable operation ///</summary> #region Redoing the modification SuspensionCoordinatesRearRight _scrr_forRedo = (SuspensionCoordinatesRearRight)modify_scrr_list; ICommand cmd = Assy_List_SCRR[l_modify_scrr]; Assy_List_SCRR[l_modify_scrr]._UndocommandsSCRR.Push(cmd); Assy_List_SCRR[l_modify_scrr] = _scrr_forRedo; PopulateDataTable(l_modify_scrr); Assy_List_SCRR[l_modify_scrr].SCRRIsModified = true; SuspensionCoordinatesRearRightGUI.DisplaySCRRItem(Assy_List_SCRR[l_modify_scrr]); #region Calling Redo method for Opposite Suspension if symmetric if (Assy_List_SCRR[l_modify_scrr].RearSymmetry == true && IsUndoRedoCalledByLeft == false) { SuspensionCoordinatesRear.IsUndoRedoCalledByRight_IdentifierMethod(true);// This method sets the IsUndoRedoCalledByRight variable to true and prevents an infinte loop UndoRedo undoRedo = new UndoRedo(); undoRedo.Identifier(SuspensionCoordinatesRear.Assy_List_SCRL[l_modify_scrr]._UndocommandsSCRL, SuspensionCoordinatesRear.Assy_List_SCRL[l_modify_scrr]._RedocommandsSCRL, l_modify_scrr + 1, SuspensionCoordinatesRear.Assy_List_SCRL[l_modify_scrr].SCRLIsModified); undoRedo.Redo(1); SuspensionCoordinatesRear.IsUndoRedoCalledByRight_IdentifierMethod(false);// This method sets the IsUndoRedoCalledByRight variable to false and allows the left suspenson coordinate to be undone } #endregion Kinematics_Software_New.EditRearCAD(l_modify_scrr); Kinematics_Software_New.SCRR_ModifyInVehicle(l_modify_scrr, Assy_List_SCRR[l_modify_scrr]); #endregion }