Changeset 1102 for trunk/eraser6/Eraser.Manager/Task.cs
- Timestamp:
- 6/3/2009 3:55:56 AM (4 years ago)
- File:
-
- 1 edited
-
trunk/eraser6/Eraser.Manager/Task.cs (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser6/Eraser.Manager/Task.cs
r1085 r1102 47 47 Targets.Owner = this; 48 48 Log = (Logger)info.GetValue("Log", typeof(Logger)); 49 Canceled = false; 49 50 50 51 Schedule schedule = (Schedule)info.GetValue("Schedule", typeof(Schedule)); … … 80 81 Targets = new ErasureTargetsCollection(this); 81 82 Schedule = Schedule.RunNow; 83 Canceled = false; 82 84 Log = new Logger(); 83 85 } … … 138 140 /// executor is idle. 139 141 /// </summary> 140 public bool Queued { get; internal set; } 142 public bool Queued 143 { 144 get 145 { 146 return Executor.IsTaskQueued(this); 147 } 148 } 141 149 142 150 /// <summary> … … 153 161 /// The schedule for running the task. 154 162 /// </summary> 155 public Schedule Schedule { get; set; } 163 public Schedule Schedule 164 { 165 get 166 { 167 return schedule; 168 } 169 set 170 { 171 if (schedule.Owner != null) 172 throw new ArgumentException(S._("The schedule provided can only " + 173 "belong to one task at a time")); 174 175 if (schedule is RecurringSchedule) 176 ((RecurringSchedule)schedule).Owner = null; 177 schedule = value; 178 if (schedule is RecurringSchedule) 179 ((RecurringSchedule)schedule).Owner = this; 180 OnTaskEdited(); 181 } 182 } 156 183 157 184 /// <summary> … … 160 187 public Logger Log { get; private set; } 161 188 189 private Schedule schedule; 190 162 191 #region Events 163 192 /// <summary> 193 /// The task has been edited. 194 /// </summary> 195 public EventHandler<TaskEventArgs> TaskEdited { get; set; } 196 197 /// <summary> 164 198 /// The start of the execution of a task. 165 199 /// </summary> … … 175 209 /// </summary> 176 210 public EventHandler<TaskEventArgs> TaskFinished { get; set; } 211 212 /// <summary> 213 /// Broadcasts the task edited event. 214 /// </summary> 215 internal void OnTaskEdited() 216 { 217 if (TaskEdited != null) 218 TaskEdited(this, new TaskEventArgs(this)); 219 } 177 220 178 221 /// <summary> … … 613 656 result.AddRange(GetFiles(dir)); 614 657 } 615 catch ( Exception e)658 catch (DirectoryNotFoundException e) 616 659 { 617 660 //Ignore, but log. … … 720 763 foreach (FileSystemInfo fsInfo in info.GetFileSystemInfos()) 721 764 { 722 if (fsInfo is FileInfo) 765 FileInfo fileInfo = fsInfo as FileInfo; 766 if (fileInfo != null) 723 767 { 724 totalSize += ((FileInfo)fsInfo).Length;725 GetPathADSes(paths, out totalSize, f sInfo.FullName);726 paths.Add(f sInfo.FullName);768 totalSize += fileInfo.Length; 769 GetPathADSes(paths, out totalSize, fileInfo.FullName); 770 paths.Add(fileInfo.FullName); 727 771 } 728 772 else
Note: See TracChangeset
for help on using the changeset viewer.
