Ignore:
Timestamp:
1/5/2009 10:01:55 AM (3 years ago)
Author:
lowjoel
Message:

-Allow users to create tasks by right clicking in the scheduler list view
-Remove the unused and disabled menu entries in the Scheduler tool bar item

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Eraser/SchedulerPanel.cs

    r787 r854  
    3232using System.Globalization; 
    3333using System.Runtime.InteropServices; 
     34using System.Diagnostics; 
    3435 
    3536namespace Eraser 
     
    120121            //Display a balloon notification if the parent frame has been minimised. 
    121122            MainForm parent = (MainForm)FindForm(); 
     123            Debug.Assert(parent != null); 
    122124            if (parent.WindowState == FormWindowState.Minimized || !parent.Visible) 
    123125            { 
     
    285287        private void schedulerMenu_Opening(object sender, CancelEventArgs e) 
    286288        { 
    287             //If nothing's selected, don't show the menu 
     289            //If nothing's selected, show the Scheduler menu which just allows users to 
     290            //create new tasks (like from the toolbar) 
    288291            if (scheduler.SelectedItems.Count == 0) 
    289292            { 
     293                schedulerDefaultMenu.Show(schedulerMenu.Left, schedulerMenu.Top); 
    290294                e.Cancel = true; 
    291295                return; 
     
    307311                !((Task)scheduler.SelectedItems[0].Tag).Executing; 
    308312            deleteTaskToolStripMenuItem.Enabled = !aTaskExecuting; 
     313        } 
     314 
     315        /// <summary> 
     316        /// Occurs when the user selects the New Task context menu item. 
     317        /// </summary> 
     318        /// <param name="sender">The menu which generated this event.</param> 
     319        /// <param name="e">Event argument.</param> 
     320        private void newTaskToolStripMenuItem_Click(object sender, EventArgs e) 
     321        { 
     322            using (TaskPropertiesForm form = new TaskPropertiesForm()) 
     323            { 
     324                if (form.ShowDialog() == DialogResult.OK) 
     325                { 
     326                    Task task = form.Task; 
     327                    Program.eraserClient.AddTask(ref task); 
     328                } 
     329            } 
    309330        } 
    310331 
Note: See TracChangeset for help on using the changeset viewer.