Changeset 7152 for trunk/sources/HeuristicLab.Clients.Hive.JobManager
- Timestamp:
- 12/07/11 21:00:11 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs
r7078 r7152 61 61 62 62 protected override void Content_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<RefreshableJob> e) { 63 base.Content_ItemsAdded(sender, e); 64 foreach (ColumnHeader c in this.itemsListView.Columns) { 65 c.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 66 } 67 foreach (var item in e.Items) { 68 item.ItemImageChanged += new EventHandler(item_ItemImageChanged); 63 if (InvokeRequired) { 64 Invoke(new CollectionItemsChangedEventHandler<RefreshableJob>(Content_ItemsAdded), sender, e); 65 } else { 66 base.Content_ItemsAdded(sender, e); 67 foreach (ColumnHeader c in this.itemsListView.Columns) { 68 c.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 69 } 70 foreach (var item in e.Items) { 71 item.ItemImageChanged += new EventHandler(item_ItemImageChanged); 72 } 69 73 } 70 74 } 71 75 72 76 void item_ItemImageChanged(object sender, EventArgs e) { 73 if (this.itemsListView.InvokeRequired) { 74 Invoke(new EventHandler(item_ItemImageChanged), sender, e); 75 } else { 76 RefreshableJob job = sender as RefreshableJob; 77 if (job != null) { 78 foreach (ListViewItem item in this.itemsListView.Items) { 79 if (item.Tag != null) 80 { 81 RefreshableJob cur = item.Tag as RefreshableJob; 82 if (cur != null && cur == job) 83 { 84 this.UpdateListViewItemImage(item); 85 } 86 } 77 if (this.itemsListView.InvokeRequired) { 78 Invoke(new EventHandler(item_ItemImageChanged), sender, e); 79 } else { 80 RefreshableJob job = sender as RefreshableJob; 81 if (job != null) { 82 foreach (ListViewItem item in this.itemsListView.Items) { 83 if (item.Tag != null) { 84 RefreshableJob cur = item.Tag as RefreshableJob; 85 if (cur != null && cur == job) { 86 this.UpdateListViewItemImage(item); 87 } 87 88 } 88 } 89 } 90 } 89 91 } 90 92 } 91 93 92 94 protected override void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<RefreshableJob> e) { 93 base.Content_ItemsRemoved(sender, e); 94 foreach (var item in e.Items) { 95 item.ItemImageChanged -= new EventHandler(item_ItemImageChanged); 96 } 97 if (Content != null && Content.Count == 0) { 98 foreach (ColumnHeader c in this.itemsListView.Columns) { 99 c.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); 95 if (InvokeRequired) { 96 Invoke(new CollectionItemsChangedEventHandler<RefreshableJob>(Content_ItemsRemoved), sender, e); 97 } else { 98 base.Content_ItemsRemoved(sender, e); 99 foreach (var item in e.Items) { 100 item.ItemImageChanged -= new EventHandler(item_ItemImageChanged); 101 } 102 if (Content != null && Content.Count == 0) { 103 foreach (ColumnHeader c in this.itemsListView.Columns) { 104 c.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); 105 } 100 106 } 101 107 }
Note: See TracChangeset
for help on using the changeset viewer.