Esempio n. 1
0
        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
        }
Esempio n. 2
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
        }