示例#1
0
        private void AddNewTrigger()
        {
            Trigger trigger       = new Trigger();
            var     triggerVm     = new TriggerVm(trigger, _avalibleSignals);
            var     triggerWindow = new Views.TriggerWindow();

            triggerWindow.DataContext = triggerVm;

            triggerWindow.ShowDialog();

            if (triggerVm.IS_SAVED)
            {
                _triggerEngine.AddTrigger(trigger);
                ObservableTriggers.Refresh();
            }
        }
示例#2
0
        private void RemoveTrigger()
        {
            var trigger = (Trigger)ObservableTriggers.CurrentItem;

            if (trigger == null)
            {
                DialogResult msgBox = MessageBox.Show("No trigger is selected");
                return;
            }

            DialogResult dialogResult = MessageBox.Show("Are you sure you want to delete " + trigger.Name + " ?", "Confirm dialog", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                _triggerEngine.RemoveTrigger(trigger);
                ObservableTriggers.Refresh();
            }
            else if (dialogResult == DialogResult.No)
            {
            }
        }