Changeset 1969


Ignore:
Timestamp:
4/28/2010 4:54:14 AM (5 years ago)
Author:
lowjoel
Message:

Forward-port from Eraser 6.0: Apply the task schedule before calling the task added event. Fixes #271.

Location:
trunk/eraser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser

  • trunk/eraser/Eraser.Manager/DirectExecutor.cs

    r1882 r1969  
    845845                    list.Insert(index, item); 
    846846 
     847                //If the task is scheduled to run now, break the waiting thread and 
     848                //run it immediately 
     849                if (item.Schedule == Schedule.RunNow) 
     850                { 
     851                    Owner.QueueTask(item); 
     852                } 
     853                //If the task is scheduled, add the next execution time to the list 
     854                //of schduled tasks. 
     855                else if (item.Schedule != Schedule.RunOnRestart) 
     856                { 
     857                    Owner.ScheduleTask(item); 
     858                } 
     859 
    847860                //Call all the event handlers who registered to be notified of tasks 
    848861                //being added. 
    849862                Owner.OnTaskAdded(new TaskEventArgs(item)); 
    850  
    851                 //If the task is scheduled to run now, break the waiting thread and 
    852                 //run it immediately 
    853                 if (item.Schedule == Schedule.RunNow) 
    854                 { 
    855                     Owner.QueueTask(item); 
    856                 } 
    857                 //If the task is scheduled, add the next execution time to the list 
    858                 //of schduled tasks. 
    859                 else if (item.Schedule != Schedule.RunOnRestart) 
    860                 { 
    861                     Owner.ScheduleTask(item); 
    862                 } 
    863863            } 
    864864 
Note: See TracChangeset for help on using the changeset viewer.