Пример #1
0
        public void ModifyObjectData(int l_modify_arb, object modify_arb_list, bool redo_Identifier)
        {
            ///<summary>
            ///In this section of the code, the tire is bring modified and it is placed under the method called Execute because it is an Undoable operation
            ///</summary>

            #region Editing the ARB object in the list of ARB objects
            AntiRollBar arb_list;

            if (redo_Identifier == false)
            {
                arb_list = new AntiRollBar((AntiRollBarGUI)modify_arb_list);
            }
            else
            {
                arb_list = (AntiRollBar)modify_arb_list;
            }

            ICommand cmd = Assy_List_ARB[l_modify_arb];
            Assy_List_ARB[l_modify_arb]._UndocommandsARB.Push(cmd);

            arb_list._UndocommandsARB = Assy_List_ARB[l_modify_arb]._UndocommandsARB;
            arb_list._RedocommandsARB = Assy_List_ARB[l_modify_arb]._RedocommandsARB;
            arb_list._ARBName         = Assy_List_ARB[l_modify_arb]._ARBName;

            Assy_List_ARB[l_modify_arb] = arb_list;
            Assy_List_ARB[l_modify_arb].ARBDataTable          = arb_list.ARBDataTable;
            Assy_List_ARB[l_modify_arb].AntiRollBarID         = l_modify_arb + 1;
            Assy_List_ARB[l_modify_arb].AntiRollBarIsModified = true;

            PopulateDataTable(l_modify_arb);

            #endregion

            if (redo_Identifier == false)
            {
                _RedocommandsARB.Clear();
            }


            AntiRollBarGUI.DisplayARBItem(Assy_List_ARB[l_modify_arb]);

            Kinematics_Software_New.ARB_ModifyInVehicle(l_modify_arb, Assy_List_ARB[l_modify_arb]);
        }
Пример #2
0
        public void Undo_ModifyObjectData(int l_unexecute_arb, ICommand command)
        {
            ///<summary>
            /// This code is to undo the modification action which the user has performed
            /// </summary>

            #region Undoing the modification
            try
            {
                ICommand cmd = Assy_List_ARB[l_unexecute_arb];
                Assy_List_ARB[l_unexecute_arb]._RedocommandsARB.Push(cmd);

                Assy_List_ARB[l_unexecute_arb] = (AntiRollBar)command;

                PopulateDataTable(l_unexecute_arb);

                AntiRollBarGUI.DisplayARBItem(Assy_List_ARB[l_unexecute_arb]);

                Kinematics_Software_New.ARB_ModifyInVehicle(l_unexecute_arb, Assy_List_ARB[l_unexecute_arb]);
            }
            catch (Exception) { }
            #endregion
        }