public void propertyGrid_PropertyValueChanged(Object s, PropertyValueChangedEventArgs e)
        {
            AppManager.mMainWindow.setPrograssBarVisible(true);
            AppManager.mMainWindow.setPrograssBarName("应用属性");
            Object[] selobj = propertyGrid.SelectedObjects;
            int      len    = selobj.Length;

            AppManager.mMainWindow.setPrograssBarMaxium(len);
            AppManager.mMainWindow.setPrograssBarValue(0);

            VsqEvent[] items = new VsqEvent[len];
            for (int i = 0; i < len; i++)
            {
                SelectedEventEntry proxy = (SelectedEventEntry)selobj[i];
                items[i] = proxy.editing;
                Application.DoEvents();
            }
            CadenciiCommand run = new CadenciiCommand(VsqCommand.generateCommandEventReplaceRange(m_track, items));

            if (CommandExecuteRequired != null)
            {
                CommandExecuteRequired(this, run);
            }
            for (int i = 0; i < len; i++)
            {
                AppManager.itemSelection.addEvent(items[i].InternalID);
                AppManager.mMainWindow.setPrograssBarValue(i);
                Application.DoEvents();
            }
            propertyGrid.Refresh();
            setEditing(false);
            AppManager.mMainWindow.setPrograssBarVisible(false);
        }
 public CadenciiCommand(VsqCommand command)
 {
     type       = CadenciiCommandType.VSQ_COMMAND;
     vsqCommand = command;
     mChild     = new List <ICommand>();
 }
        private void applyValue(bool mode_clock)
        {
            if (!m_changed)
            {
                return;
            }
            int value = m_curve.getDefault();

            try {
                value = int.Parse(txtDataPointValue.Text);
            } catch (Exception ex) {
                Logger.write(typeof(FormCurvePointEdit) + ".applyValue; ex=" + ex + "\n");
                return;
            }
            if (value < m_curve.getMinimum())
            {
                value = m_curve.getMinimum();
            }
            else if (m_curve.getMaximum() < value)
            {
                value = m_curve.getMaximum();
            }

            int clock = 0;

            try {
                clock = int.Parse(txtDataPointClock.Text);
            } catch (Exception ex) {
                Logger.write(typeof(FormCurvePointEdit) + ".applyValue; ex=" + ex + "\n");
                return;
            }

            int       selected  = AppManager.getSelected();
            VsqTrack  vsq_track = AppManager.getVsqFile().Track[selected];
            VsqBPList src       = vsq_track.getCurve(m_curve.getName());
            VsqBPList list      = (VsqBPList)src.clone();

            VsqBPPairSearchContext context = list.findElement(m_editing_id);

            list.move(context.clock, clock, value);
            CadenciiCommand run = new CadenciiCommand(VsqCommand.generateCommandTrackCurveReplace(selected,
                                                                                                  m_curve.getName(),
                                                                                                  list));
            EditedZone zone = new EditedZone();

            Utility.compareList(zone, new VsqBPListComparisonContext(list, src));
            List <EditedZoneUnit> zoneUnits = new List <EditedZoneUnit>();

            foreach (var item in zone.iterator())
            {
                zoneUnits.Add(item);
            }
            AppManager.editHistory.register(AppManager.getVsqFile().executeCommand(run));

            txtDataPointClock.Text = clock + "";
            txtDataPointValue.Text = value + "";

            if (mMainWindow != null)
            {
                mMainWindow.setEdited(true);
                mMainWindow.ensureVisible(clock);
                mMainWindow.refreshScreen();
            }

            if (mode_clock)
            {
                txtDataPointClock.SelectAll();
            }
            else
            {
                txtDataPointValue.SelectAll();
            }

            btnUndo.Enabled = AppManager.editHistory.hasUndoHistory();
            btnRedo.Enabled = AppManager.editHistory.hasRedoHistory();
            m_changed       = false;
        }