コード例 #1
0
ファイル: SchedulerPanel.cs プロジェクト: gtrant/eraser
        /// <summary>
        /// Occurs when the user selects the Edit Task context menu item.
        /// </summary>
        /// <param name="sender">The menu item which generated this event.</param>
        /// <param name="e">Event argument.</param>
        private void editTaskToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (scheduler.SelectedItems.Count != 1 ||
                ((Task)scheduler.SelectedItems[0].Tag).Executing ||
                ((Task)scheduler.SelectedItems[0].Tag).Queued)
            {
                return;
            }

            //Make sure that the task is not being executed, or else. This can
            //be done in the Client library, but there will be no effect on the
            //currently running task.
            ListViewItem item = scheduler.SelectedItems[0];
            Task         task = (Task)item.Tag;

            if (task.Executing)
            {
                return;
            }

            //Edit the task.
            using (TaskPropertiesForm form = new TaskPropertiesForm())
            {
                form.Task = task;
                if (form.ShowDialog() == DialogResult.OK)
                {
                    task = form.Task;

                    //Update the list view
                    UpdateTask(item);
                }
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: herocodemaster/eraser
 private void newTaskToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (TaskPropertiesForm form = new TaskPropertiesForm())
     {
         if (form.ShowDialog() == DialogResult.OK)
         {
             Task task = form.Task;
             Program.eraserClient.Tasks.Add(task);
         }
     }
 }
コード例 #3
0
 private void OptionsButton_Click(object sender, EventArgs e)
 {
     using (TaskPropertiesForm form = new TaskPropertiesForm())
     {
         form.Task = Task;
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             Task = form.Task;
         }
     }
 }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: RoDaniel/featurehouse
 private void newTaskToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (TaskPropertiesForm form = new TaskPropertiesForm())
        {
     if (form.ShowDialog() == DialogResult.OK)
     {
      Task task = form.Task;
      Program.eraserClient.Tasks.Add(task);
     }
        }
 }
コード例 #5
0
 private void editTaskToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (scheduler.SelectedItems.Count != 1 ||
     ((Task)scheduler.SelectedItems[0].Tag).Executing ||
     ((Task)scheduler.SelectedItems[0].Tag).Queued)
        {
     return;
        }
        ListViewItem item = scheduler.SelectedItems[0];
        Task task = (Task)item.Tag;
        if (task.Executing)
     return;
        using (TaskPropertiesForm form = new TaskPropertiesForm())
        {
     form.Task = task;
     if (form.ShowDialog() == DialogResult.OK)
     {
      task = form.Task;
      UpdateTask(item);
     }
        }
 }