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 ModifyObjectData(int l_modify_SCFL, object modify_scfl_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 Redo the Modification SuspensionCoordinatesFront _scfl_forRedo = (SuspensionCoordinatesFront)modify_scfl_list; ICommand cmd = Assy_List_SCFL[l_modify_SCFL]; Assy_List_SCFL[l_modify_SCFL]._UndocommandsSCFL.Push(cmd); Assy_List_SCFL[l_modify_SCFL] = _scfl_forRedo; PopulateDataTable(l_modify_SCFL); Assy_List_SCFL[l_modify_SCFL].SCFLIsModified = true; SuspensionCoordinatesFrontGUI.DisplaySCFLItem(Assy_List_SCFL[l_modify_SCFL]); #region Calling Redo method for Opposite Suspension if symmetric if (Assy_List_SCFL[l_modify_SCFL].FrontSymmetry == true && IsUndoRedoCalledByRight == false) { SuspensionCoordinatesFrontRight.IsUndoRedoCalledByLeft_IdentifierMethod(true);// This method sets the IsUndoRedoCalledByLeft variable to true and prevents an infinte loop UndoRedo undoRedo = new UndoRedo(); undoRedo.Identifier(SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_modify_SCFL]._UndocommandsSCFR, SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_modify_SCFL]._RedocommandsSCFR, l_modify_SCFL + 1, SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_modify_SCFL].SCFRIsModified); undoRedo.Redo(1); SuspensionCoordinatesFrontRight.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.EditFrontCAD(l_modify_SCFL); Kinematics_Software_New.SCFL_ModifyInVehicle(l_modify_SCFL, Assy_List_SCFL[l_modify_SCFL]); #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 }
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 }
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 }