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 }
/// <summary> /// /// </summary> /// <param name="l_modify_scrl"></param> /// <param name="modify_scrl_list"></param> /// <param name="redo_Identifier"></param> public void ModifyObjectData(int l_modify_scrl, object modify_scrl_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 SuspensionCoordinatesRear _scrl_forRedo = (SuspensionCoordinatesRear)modify_scrl_list; ICommand cmd = Assy_List_SCRL[l_modify_scrl]; Assy_List_SCRL[l_modify_scrl]._UndocommandsSCRL.Push(cmd); Assy_List_SCRL[l_modify_scrl] = _scrl_forRedo; PopulateDataTable(l_modify_scrl); Assy_List_SCRL[l_modify_scrl].SCRLIsModified = true; SuspensionCoordinatesRearGUI.DisplaySCRLItem(Assy_List_SCRL[l_modify_scrl]); #region Calling Redo method for Opposite Suspension if symmetric if (Assy_List_SCRL[l_modify_scrl].RearSymmetry == true && IsUndoRedoCalledByRight == false) { SuspensionCoordinatesRearRight.IsUndoRedoCalledByLeft_IdentifierMethod(true); UndoRedo undoRedo = new UndoRedo(); undoRedo.Identifier(SuspensionCoordinatesRearRight.Assy_List_SCRR[l_modify_scrl]._UndocommandsSCRR, SuspensionCoordinatesRearRight.Assy_List_SCRR[l_modify_scrl]._RedocommandsSCRR, l_modify_scrl + 1, SuspensionCoordinatesRearRight.Assy_List_SCRR[l_modify_scrl].SCRRIsModified); undoRedo.Redo(1); SuspensionCoordinatesRearRight.IsUndoRedoCalledByLeft_IdentifierMethod(false); } #endregion Kinematics_Software_New.EditRearCAD(l_modify_scrl); Kinematics_Software_New.SCRL_ModifyInVehicle(l_modify_scrl, Assy_List_SCRL[l_modify_scrl]); #endregion }