- Timestamp:
- 01/18/13 10:26:25 (12 years ago)
- Location:
- branches/UnloadJobs/HeuristicLab.Clients.Hive/3.3/HiveTasks
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UnloadJobs/HeuristicLab.Clients.Hive/3.3/HiveTasks/HiveTask.cs
r8939 r9173 36 36 [Item("Hive Task", "Represents a hive task.")] 37 37 [StorableClass] 38 public class HiveTask : NamedItem, IItemTree<HiveTask> {38 public class HiveTask : NamedItem, IItemTree<HiveTask>, IDisposable { 39 39 protected static object locker = new object(); 40 40 protected ReaderWriterLockSlim childHiveTasksLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion); … … 67 67 set { 68 68 if (task != value) { 69 Deregister JobEvents();69 DeregisterTaskEvents(); 70 70 task = value; 71 Register JobEvents();71 RegisterTaskEvents(); 72 72 IsFinishedTaskDownloaded = false; 73 73 OnTaskChanged(); … … 93 93 itemTaskLock.EnterWriteLock(); 94 94 try { 95 Der gisterItemTaskEvents();95 DeregisterItemTaskEvents(); 96 96 itemTask = value; 97 97 RegisterItemTaskEvents(); … … 177 177 this.childHiveTasks = new ItemList<HiveTask>(); 178 178 syncTasksWithOptimizers = true; 179 RegisterChildHive JobEvents();179 RegisterChildHiveTasksEvents(); 180 180 } 181 181 … … 198 198 this.childHiveTasks = new ItemList<HiveTask>(); 199 199 this.syncTasksWithOptimizers = true; 200 RegisterChildHive JobEvents();200 RegisterChildHiveTasksEvents(); 201 201 } 202 202 … … 226 226 } 227 227 } 228 protected virtual void Der gisterItemTaskEvents() {228 protected virtual void DeregisterItemTaskEvents() { 229 229 if (ItemTask != null) { 230 230 ItemTask.ComputeInParallelChanged -= new EventHandler(ItemJob_ComputeInParallelChanged); … … 233 233 } 234 234 235 protected virtual void RegisterChildHive JobEvents() {235 protected virtual void RegisterChildHiveTasksEvents() { 236 236 this.childHiveTasks.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<HiveTask>>(OnItemsAdded); 237 237 this.childHiveTasks.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<HiveTask>>(OnItemsRemoved); 238 238 this.childHiveTasks.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<HiveTask>>(OnCollectionReset); 239 239 } 240 protected virtual void DeregisterChildHive JobEvents() {240 protected virtual void DeregisterChildHiveTasksEvents() { 241 241 this.childHiveTasks.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<HiveTask>>(OnItemsAdded); 242 242 this.childHiveTasks.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<HiveTask>>(OnItemsRemoved); … … 342 342 } 343 343 344 private void Register JobEvents() {344 private void RegisterTaskEvents() { 345 345 if (task != null) 346 346 task.PropertyChanged += new PropertyChangedEventHandler(task_PropertyChanged); 347 347 } 348 348 349 private void Deregister JobEvents() {349 private void DeregisterTaskEvents() { 350 350 if (task != null) 351 351 task.PropertyChanged += new PropertyChangedEventHandler(task_PropertyChanged); … … 526 526 this.ItemTask.Item = null; 527 527 } 528 529 public void Dispose() { 530 DeregisterChildHiveTasksEvents(); 531 DeregisterTaskEvents(); 532 DeregisterItemTaskEvents(); 533 childHiveTasksLock.Dispose(); 534 itemTaskLock.Dispose(); 535 } 528 536 } 529 537 -
branches/UnloadJobs/HeuristicLab.Clients.Hive/3.3/HiveTasks/OptimizerHiveTask.cs
r8939 r9173 107 107 } 108 108 } 109 protected override void Der gisterItemTaskEvents() {110 base.Der gisterItemTaskEvents();109 protected override void DeregisterItemTaskEvents() { 110 base.DeregisterItemTaskEvents(); 111 111 if (ItemTask != null) { 112 112 if (ItemTask.Item is Optimization.Experiment) {
Note: See TracChangeset
for help on using the changeset viewer.