private void actionNewButton_Click(object sender, EventArgs e)
 {
     using (ActionEditDialog dlg = new ActionEditDialog {
         SupportV1Only = !editor.IsV2
     })
     {
         dlg.Text = EditorProperties.Resources.ActionDlgNewCaption;
         dlg.UseUnifiedSchedulingEngine = editor.TaskDefinition.Settings.UseUnifiedSchedulingEngine;
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             editor.TaskDefinition.Actions.Add(dlg.Action);
             AddActionToList(dlg.Action, -1);
             SetActionButtonState();
         }
     }
 }
        private void actionEditButton_Click(object sender, EventArgs e)
        {
            int idx = SelectedIndex;

            if (idx >= 0)
            {
                using (ActionEditDialog dlg = new ActionEditDialog(actionListView.Items[idx].Tag as Action))
                {
                    if (!editor.IsV2 && !dlg.SupportV1Only)
                    {
                        dlg.SupportV1Only = true;
                    }
                    dlg.Text = EditorProperties.Resources.ActionDlgEditCaption;
                    dlg.UseUnifiedSchedulingEngine = editor.TaskDefinition.Settings.UseUnifiedSchedulingEngine;
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        actionListView.Items.RemoveAt(idx);
                        editor.TaskDefinition.Actions[idx] = dlg.Action;
                        AddActionToList(dlg.Action, idx);
                        actionListView.Items[idx].Selected = true;
                    }
                }
            }
        }
 private void actionNewButton_Click(object sender, EventArgs e)
 {
     using (ActionEditDialog dlg = new ActionEditDialog { SupportV1Only = !editor.IsV2 })
     {
         dlg.Text = EditorProperties.Resources.ActionDlgNewCaption;
         dlg.UseUnifiedSchedulingEngine = editor.TaskDefinition.Settings.UseUnifiedSchedulingEngine;
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             editor.TaskDefinition.Actions.Add(dlg.Action);
             AddActionToList(dlg.Action, -1);
             SetActionButtonState();
         }
     }
 }
 private void actionEditButton_Click(object sender, EventArgs e)
 {
     int idx = SelectedIndex;
     if (idx >= 0)
     {
         using (ActionEditDialog dlg = new ActionEditDialog(actionListView.Items[idx].Tag as Action))
         {
             if (!editor.IsV2 && !dlg.SupportV1Only) dlg.SupportV1Only = true;
             dlg.Text = EditorProperties.Resources.ActionDlgEditCaption;
             dlg.UseUnifiedSchedulingEngine = editor.TaskDefinition.Settings.UseUnifiedSchedulingEngine;
             if (dlg.ShowDialog() == DialogResult.OK)
             {
                 actionListView.Items.RemoveAt(idx);
                 editor.TaskDefinition.Actions[idx] = dlg.Action;
                 AddActionToList(dlg.Action, idx);
                 actionListView.Items[idx].Selected = true;
             }
         }
     }
 }