Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/07/11 21:00:11 (13 years ago)
Author:
ascheibe
Message:

#1672

  • added missing invokes
  • removed collecting types of object graph for retrieval of plugins as this isn't needed for MetaOpt. I think the problem was that MetaOpt always stored types of all available algorithms and problems which caused the problem (#1527) with Hive.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs

    r7078 r7152  
    6161
    6262    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        }
    6973      }
    7074    }
    7175
    7276    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              }
    8788            }
    88          }
     89          }
     90        }
    8991      }
    9092    }
    9193
    9294    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          }
    100106        }
    101107      }
Note: See TracChangeset for help on using the changeset viewer.