public void Undo_ModifyObjectData(int l_unexcute_scfl, ICommand command)
        {
            ///<summary>
            /// This code is to undo the modification action which the user has performed
            /// </summary>

            #region Undo the Modification
            try
            {
                SuspensionCoordinatesFront _scfl_forUndo = (SuspensionCoordinatesFront)command;

                ICommand cmd = Assy_List_SCFL[l_unexcute_scfl];
                Assy_List_SCFL[l_unexcute_scfl]._RedocommandsSCFL.Push(cmd);

                Assy_List_SCFL[l_unexcute_scfl] = _scfl_forUndo;

                PopulateDataTable(l_unexcute_scfl);

                SuspensionCoordinatesFrontGUI.DisplaySCFLItem(Assy_List_SCFL[l_unexcute_scfl]);

                #region Calling Undo method for Opposite Suspension if symmetric
                if (Assy_List_SCFL[l_unexcute_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_unexcute_scfl]._UndocommandsSCFR, SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_unexcute_scfl]._RedocommandsSCFR,
                                        l_unexcute_scfl + 1, SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_unexcute_scfl].SCFRIsModified);
                    undoRedo.Undo(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_unexcute_scfl);

                Kinematics_Software_New.SCFL_ModifyInVehicle(l_unexcute_scfl, Assy_List_SCFL[l_unexcute_scfl]);
            }
            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
        }
Exemple #3
0
        public void ModifyObjectData(int l_modify_scfr, object modify_scfr_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
            SuspensionCoordinatesFrontRight _scfr_forRedo = (SuspensionCoordinatesFrontRight)modify_scfr_list;

            ICommand cmd = Assy_List_SCFR[l_modify_scfr];
            Assy_List_SCFR[l_modify_scfr]._UndocommandsSCFR.Push(cmd);

            Assy_List_SCFR[l_modify_scfr] = _scfr_forRedo;
            Assy_List_SCFR[l_modify_scfr].SCFRIsModified = true;

            PopulateDataTable(l_modify_scfr);

            SuspensionCoordinatesFrontRightGUI.DisplaySCFRItem(Assy_List_SCFR[l_modify_scfr]);

            #region Calling Redo method for Opposite Suspension if symmetric
            if (SuspensionCoordinatesFrontRight.Assy_List_SCFR[l_modify_scfr].FrontSymmetry == true && IsUndoRedoCalledByLeft == false)
            {
                SuspensionCoordinatesFront.IsUndoRedoCalledByRight_IdentifierMethod(true);
                UndoRedo undoRedo = new UndoRedo();
                undoRedo.Identifier(SuspensionCoordinatesFront.Assy_List_SCFL[l_modify_scfr]._UndocommandsSCFL, SuspensionCoordinatesFront.Assy_List_SCFL[l_modify_scfr]._RedocommandsSCFL,
                                    l_modify_scfr + 1, SuspensionCoordinatesFront.Assy_List_SCFL[l_modify_scfr].SCFLIsModified);
                undoRedo.Redo(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_modify_scfr);

            Kinematics_Software_New.SCFR_ModifyInVehicle(l_modify_scfr, Assy_List_SCFR[l_modify_scfr]);


            #endregion
        }