예제 #1
0
        public void ModifyObjectData(int l_modify_damper, object modify_damper_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 Damper Object in the list of Damper Objects
            Damper damper_list;
            if (redo_Identifier == false)
            {
                damper_list = new Damper((DamperGUI)modify_damper_list);
            }
            else
            {
                damper_list = (Damper)modify_damper_list;
            }

            ICommand cmd = Assy_List_Damper[l_modify_damper];
            Assy_List_Damper[l_modify_damper]._UndocommandsDamper.Push(cmd);

            damper_list._UndocommandsDamper = Assy_List_Damper[l_modify_damper]._UndocommandsDamper;
            damper_list._RedocommandsDamper = Assy_List_Damper[l_modify_damper]._RedocommandsDamper;
            damper_list._DamperName         = Assy_List_Damper[l_modify_damper]._DamperName;

            Assy_List_Damper[l_modify_damper] = damper_list;
            Assy_List_Damper[l_modify_damper].DamperDataTable  = damper_list.DamperDataTable;
            Assy_List_Damper[l_modify_damper].DamperID         = l_modify_damper + 1;
            Assy_List_Damper[l_modify_damper].DamperIsModified = true;

            PopulateDataTable(l_modify_damper);

            #endregion

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

            DamperGUI.DisplayDamperItem(Assy_List_Damper[l_modify_damper]);

            Kinematics_Software_New.Damper_ModifyInVehicle(l_modify_damper, Assy_List_Damper[l_modify_damper]);
        }
예제 #2
0
        public void Undo_ModifyObjectData(int l_unexecute_damper, ICommand command)
        {
            ///<summary>
            /// This code is to undo the modification action which the user has performed
            /// </summary>

            try
            {
                #region Undo the damper modification
                ICommand cmd = Assy_List_Damper[l_unexecute_damper];
                Assy_List_Damper[l_unexecute_damper]._RedocommandsDamper.Push(cmd);

                Assy_List_Damper[l_unexecute_damper] = (Damper)command;

                PopulateDataTable(l_unexecute_damper);

                DamperGUI.DisplayDamperItem(Assy_List_Damper[l_unexecute_damper]);

                Kinematics_Software_New.Damper_ModifyInVehicle(l_unexecute_damper, Assy_List_Damper[l_unexecute_damper]);

                #endregion
            }
            catch (Exception) { }
        }