public void Undo_ModifyObjectData(int l_unexcute_scrl, ICommand command) { ///<summary> /// This code is to undo the modification action which the user has performed /// </summary> #region Undoing the modification try { SuspensionCoordinatesRear _scrl_forUndo = (SuspensionCoordinatesRear)command; ICommand cmd = Assy_List_SCRL[l_unexcute_scrl]; Assy_List_SCRL[l_unexcute_scrl]._RedocommandsSCRL.Push(cmd); Assy_List_SCRL[l_unexcute_scrl] = _scrl_forUndo; PopulateDataTable(l_unexcute_scrl); SuspensionCoordinatesRearGUI.DisplaySCRLItem(Assy_List_SCRL[l_unexcute_scrl]); #region Calling Undo method for Opposite Suspension if symmetric if (Assy_List_SCRL[l_unexcute_scrl].RearSymmetry == true && IsUndoRedoCalledByRight == false) { SuspensionCoordinatesRearRight.IsUndoRedoCalledByLeft_IdentifierMethod(true);// This method sets the IsUndoRedoCalledByLeft variable to true and prevents an infinte loop UndoRedo undoRedo = new UndoRedo(); undoRedo.Identifier(SuspensionCoordinatesRearRight.Assy_List_SCRR[l_unexcute_scrl]._UndocommandsSCRR, SuspensionCoordinatesRearRight.Assy_List_SCRR[l_unexcute_scrl]._RedocommandsSCRR, l_unexcute_scrl + 1, SuspensionCoordinatesRearRight.Assy_List_SCRR[l_unexcute_scrl].SCRRIsModified); undoRedo.Undo(1); SuspensionCoordinatesRearRight.IsUndoRedoCalledByLeft_IdentifierMethod(false);//This method sets the value of IsUndoRedoCalledByLeft to false so that the Right Suspension coordinate can also be Undone } #endregion Kinematics_Software_New.EditRearCAD(l_unexcute_scrl); Kinematics_Software_New.SCRL_ModifyInVehicle(l_unexcute_scrl, Assy_List_SCRL[l_unexcute_scrl]); } catch (Exception) { } #endregion }
public void Undo_ModifyObjectData(int l_unexcute_scfr, ICommand command) { ///<summary> /// This code is to undo the modification action which the user has performed /// </summary> #region Undoing the modification try { SuspensionCoordinatesFrontRight _scfr_forUndo = (SuspensionCoordinatesFrontRight)command; ICommand cmd = Assy_List_SCFR[l_unexcute_scfr]; Assy_List_SCFR[l_unexcute_scfr]._RedocommandsSCFR.Push(cmd); Assy_List_SCFR[l_unexcute_scfr] = _scfr_forUndo; PopulateDataTable(l_unexcute_scfr); SuspensionCoordinatesFrontRightGUI.DisplaySCFRItem(Assy_List_SCFR[l_unexcute_scfr]); #region Calling Undo method for Opposite Suspension if symmetric if (SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_unexcute_scfr].FrontSymmetry == true && IsUndoRedoCalledByLeft == false) { SuspensionCoordinatesFront.IsUndoRedoCalledByRight_IdentifierMethod(true);// This method sets the IsUndoRedoCalledByRight variable to true and prevents an infinte loop UndoRedo undoRedo = new UndoRedo(); undoRedo.Identifier(SuspensionCoordinatesFront.Assy_List_SCFL[l_unexcute_scfr]._UndocommandsSCFL, SuspensionCoordinatesFront.Assy_List_SCFL[l_unexcute_scfr]._RedocommandsSCFL, l_unexcute_scfr + 1, SuspensionCoordinatesFront.Assy_List_SCFL[l_unexcute_scfr].SCFLIsModified); undoRedo.Undo(1); SuspensionCoordinatesFront.IsUndoRedoCalledByRight_IdentifierMethod(false);// This method sets the IsUndoRedoCalledByRight variable to false and allows the left suspenson coordinate to be undone } #endregion Kinematics_Software_New.EditFrontCAD(l_unexcute_scfr); Kinematics_Software_New.SCFR_ModifyInVehicle(l_unexcute_scfr, Assy_List_SCFR[l_unexcute_scfr]); } catch (Exception) { } #endregion }