Changeset 6479 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveJobs/HiveJob.cs
- Timestamp:
- 06/27/11 15:20:23 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveJobs/HiveJob.cs
r6419 r6479 108 108 public bool IsDownloading { get; set; } 109 109 110 // if true, all control buttons should be enabled. otherwise disabled 111 private bool isControllable = true; 112 public bool IsControllable { 113 get { return isControllable; } 114 set { 115 if (value != isControllable) { 116 isControllable = value; 117 OnIsControllableChanged(); 118 childHiveJobsLock.EnterReadLock(); 119 try { 120 foreach (var hiveJob in childHiveJobs) { 121 hiveJob.IsControllable = value; 122 } 123 } 124 finally { 125 childHiveJobsLock.ExitReadLock(); 126 } 127 } 128 } 129 } 130 110 131 [Storable] 111 132 protected ItemList<HiveJob> childHiveJobs; … … 296 317 } 297 318 319 public event EventHandler IsControllableChanged; 320 private void OnIsControllableChanged() { 321 var handler = IsControllableChanged; 322 if (handler != null) handler(this, EventArgs.Empty); 323 } 324 298 325 private void RegisterJobEvents() { 299 326 if (job != null) … … 303 330 private void DeregisterJobEvents() { 304 331 if (job != null) 305 job.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(job_PropertyChanged);332 job.PropertyChanged += new PropertyChangedEventHandler(job_PropertyChanged); 306 333 } 307 334 … … 397 424 foreach (var item in e.Items) { 398 425 item.Value.StateLogChanged += new EventHandler(ChildHiveJob_StateLogChanged); 426 item.Value.IsControllable = this.IsControllable; 399 427 } 400 428 var handler = ItemsAdded;
Note: See TracChangeset
for help on using the changeset viewer.