Ignore:
Timestamp:
3/11/2008 2:53:20 AM (6 years ago)
Author:
lowjoel
Message:

-Define the Task start and completion events
-Added the UIText property. This was a copy from the GenerateTaskName? function in the Scheduler panel earlier
-Added the TaskEventArgs? base class to allow for other simpler events (mainly start and finish events)
-Added the current erasure target for erase tasks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Manager/DirectExecutor.cs

    r208 r213  
    2020            thread = new Thread(delegate() 
    2121            { 
    22                 this.Main(); 
     22                Main(); 
    2323            }); 
    2424 
     
    3939                if (unusedIds.Count != 0) 
    4040                { 
    41                     task.ID = unusedIds[0]; 
     41                    task.id = unusedIds[0]; 
    4242                    unusedIds.RemoveAt(0); 
    4343                } 
    4444                else 
    45                     task.ID = ++nextId; 
     45                    task.id = ++nextId; 
    4646            } 
    4747 
     
    119119                    try 
    120120                    { 
     121                        //Broadcast the task started event. 
     122                        task.OnTaskStarted(new TaskEventArgs(task)); 
     123 
    121124                        //Run the task 
    122125                        foreach (Task.ErasureTarget target in task.Entries) 
     
    143146                        task.LogEntry(new LogEntry(e.Message, LogLevel.FATAL)); 
    144147                    } 
    145  
    146                     //If the task is a recurring task, reschedule it since we are done. 
    147                     if (task.Schedule is RecurringSchedule) 
    148                         ((RecurringSchedule)task.Schedule).Reschedule(DateTime.Now); 
     148                    finally 
     149                    { 
     150                        //And the task finished event. 
     151                        task.OnTaskFinished(new TaskEventArgs(task)); 
     152 
     153                        //If the task is a recurring task, reschedule it since we are done. 
     154                        if (task.Schedule is RecurringSchedule) 
     155                            ((RecurringSchedule)task.Schedule).Reschedule(DateTime.Now); 
     156                    } 
    149157                } 
    150158 
     
    183191                //Update the task progress 
    184192                eventArgs.overallProgress = (i * 100) / paths.Count; 
     193                eventArgs.currentTarget = target; 
    185194                eventArgs.currentItemName = paths[i]; 
    186195                eventArgs.currentItemProgress = 0; 
Note: See TracChangeset for help on using the changeset viewer.