Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/14/11 16:45:46 (14 years ago)
Author:
cneumuel
Message:

#1233

  • improved treeview for hive jobs
Location:
branches/HeuristicLab.Hive-3.4/sources
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveExperimentView.Designer.cs

    r5637 r5675  
    5252      this.experimentNamedItemView = new HeuristicLab.Core.Views.NamedItemView();
    5353      this.viewExperimentButton = new System.Windows.Forms.Button();
    54       this.jobsTabPage = new System.Windows.Forms.TabPage();
    5554      this.logTabPage = new System.Windows.Forms.TabPage();
    5655      this.logView = new HeuristicLab.Core.Views.LogView();
     
    6867      this.downloadExperimentPanel = new System.Windows.Forms.Panel();
    6968      this.useLocalPluginsCheckBox = new System.Windows.Forms.CheckBox();
    70       this.jobViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     69      this.jobsTabPage = new System.Windows.Forms.TabPage();
     70      this.jobsTreeView = new HeuristicLab.Clients.Hive.Views.ItemTreeView();
    7171      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    7272      this.tabControl.SuspendLayout();
    7373      this.experimentTabPage.SuspendLayout();
    74       this.jobsTabPage.SuspendLayout();
    7574      this.logTabPage.SuspendLayout();
    7675      this.downloadExperimentPanel.SuspendLayout();
     76      this.jobsTabPage.SuspendLayout();
    7777      this.SuspendLayout();
    7878      //
     
    161161      this.viewExperimentButton.Click += new System.EventHandler(this.showExperimentButton_Click);
    162162      //
    163       // jobsTabPage
    164       //
    165       this.jobsTabPage.Controls.Add(this.jobViewHost);
    166       this.jobsTabPage.Location = new System.Drawing.Point(4, 22);
    167       this.jobsTabPage.Name = "jobsTabPage";
    168       this.jobsTabPage.Size = new System.Drawing.Size(791, 494);
    169       this.jobsTabPage.TabIndex = 5;
    170       this.jobsTabPage.Text = "Jobs";
    171       this.jobsTabPage.UseVisualStyleBackColor = true;
    172       //
    173163      // logTabPage
    174164      //
     
    183173      // logView
    184174      //
    185       this.logView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    186                   | System.Windows.Forms.AnchorStyles.Left)
    187                   | System.Windows.Forms.AnchorStyles.Right)));
    188175      this.logView.Caption = "Log View";
    189176      this.logView.Content = null;
    190       this.logView.Location = new System.Drawing.Point(3, 4);
     177      this.logView.Dock = System.Windows.Forms.DockStyle.Fill;
     178      this.logView.Location = new System.Drawing.Point(0, 0);
    191179      this.logView.Name = "logView";
    192180      this.logView.ReadOnly = false;
    193       this.logView.Size = new System.Drawing.Size(721, 362);
     181      this.logView.Size = new System.Drawing.Size(791, 494);
    194182      this.logView.TabIndex = 0;
    195183      //
     
    343331      this.useLocalPluginsCheckBox.CheckedChanged += new System.EventHandler(this.useLocalPluginsCheckBox_CheckedChanged);
    344332      //
    345       // jobViewHost
    346       //
    347       this.jobViewHost.Caption = "View";
    348       this.jobViewHost.Content = null;
    349       this.jobViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    350       this.jobViewHost.Enabled = false;
    351       this.jobViewHost.Location = new System.Drawing.Point(0, 0);
    352       this.jobViewHost.Name = "jobViewHost";
    353       this.jobViewHost.ReadOnly = false;
    354       this.jobViewHost.Size = new System.Drawing.Size(791, 494);
    355       this.jobViewHost.TabIndex = 0;
    356       this.jobViewHost.ViewsLabelVisible = true;
    357       this.jobViewHost.ViewType = null;
     333      // jobsTabPage
     334      //
     335      this.jobsTabPage.Controls.Add(this.jobsTreeView);
     336      this.jobsTabPage.Location = new System.Drawing.Point(4, 22);
     337      this.jobsTabPage.Name = "jobsTabPage";
     338      this.jobsTabPage.Size = new System.Drawing.Size(791, 494);
     339      this.jobsTabPage.TabIndex = 5;
     340      this.jobsTabPage.Text = "Jobs";
     341      this.jobsTabPage.UseVisualStyleBackColor = true;
     342      //
     343      // jobsTreeView
     344      //
     345      this.jobsTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     346                  | System.Windows.Forms.AnchorStyles.Left)
     347                  | System.Windows.Forms.AnchorStyles.Right)));
     348      this.jobsTreeView.Caption = "ItemTree View";
     349      this.jobsTreeView.Content = null;
     350      this.jobsTreeView.Location = new System.Drawing.Point(2, 3);
     351      this.jobsTreeView.Name = "jobsTreeView";
     352      this.jobsTreeView.ReadOnly = false;
     353      this.jobsTreeView.Size = new System.Drawing.Size(786, 488);
     354      this.jobsTreeView.TabIndex = 0;
    358355      //
    359356      // HiveExperimentView
     
    396393      this.tabControl.ResumeLayout(false);
    397394      this.experimentTabPage.ResumeLayout(false);
    398       this.jobsTabPage.ResumeLayout(false);
    399395      this.logTabPage.ResumeLayout(false);
    400396      this.downloadExperimentPanel.ResumeLayout(false);
     397      this.jobsTabPage.ResumeLayout(false);
    401398      this.ResumeLayout(false);
    402399      this.PerformLayout();
     
    423420    private System.Windows.Forms.Button openExperimentButton;
    424421    private System.Windows.Forms.Button newExperimentButton;
    425     private System.Windows.Forms.TabPage jobsTabPage;
    426422    private System.Windows.Forms.Button downloadExperimentButton;
    427423    private System.Windows.Forms.Panel downloadExperimentPanel;
    428424    private System.Windows.Forms.CheckBox useLocalPluginsCheckBox;
    429     private MainForm.WindowsForms.ViewHost jobViewHost;
     425    private System.Windows.Forms.TabPage jobsTabPage;
     426    private ItemTreeView jobsTreeView;
    430427
    431428  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveExperimentView.cs

    r5637 r5675  
    105105        this.descriptionTextBox.ReadOnly = Content.ExecutionState != ExecutionState.Prepared;
    106106        this.resourceNamesTextBox.ReadOnly = Content.ExecutionState != ExecutionState.Prepared;
    107         this.jobViewHost.ReadOnly = Content.ExecutionState != ExecutionState.Prepared;
     107        this.jobsTreeView.ReadOnly = Content.ExecutionState != ExecutionState.Prepared;
    108108        this.useLocalPluginsCheckBox.Enabled = Content.ExecutionState == ExecutionState.Prepared;
    109109
     
    189189      else {
    190190        if (Content != null) {
    191           jobViewHost.Content = Content.HiveJob;
     191          jobsTreeView.Content = Content.HiveJob;
    192192          experimentNamedItemView.Content = Content.GetExperiment();
    193193        } else {
    194           jobViewHost.Content = null;
     194          jobsTreeView.Content = null;
    195195          experimentNamedItemView.Content = null;
    196196        }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/ItemTreeView.cs

    r5637 r5675  
    2020#endregion
    2121
     22using System;
    2223using System.Windows.Forms;
     24using HeuristicLab.Collections;
    2325using HeuristicLab.Common;
    2426using HeuristicLab.Core.Views;
     
    4042
    4143    protected override void DeregisterContentEvents() {
    42       // Deregister your event handlers here
     44      foreach (TreeNode node in treeView.Nodes) {
     45        DeregisterContentEvents((IItemTree)node.Tag, node);
     46      }
    4347      base.DeregisterContentEvents();
     48    }
     49
     50    private void DeregisterContentEvents(IItemTree item, TreeNode node) {
     51      item.ItemsAdded -= new CollectionItemsChangedEventHandler<IItemTree>(item_ItemsAdded);
     52      item.ItemsRemoved -= new CollectionItemsChangedEventHandler<IItemTree>(item_ItemsRemoved);
     53      item.CollectionReset -= new CollectionItemsChangedEventHandler<IItemTree>(item_CollectionReset);
     54      item.ToStringChanged -= new System.EventHandler(item_ToStringChanged);
     55      item.ItemImageChanged -= new EventHandler(item_ItemImageChanged);
     56      foreach (TreeNode childNode in node.Nodes) {
     57        DeregisterContentEvents((IItemTree)childNode.Tag, childNode);
     58      }
    4459    }
    4560
    4661    protected override void RegisterContentEvents() {
    4762      base.RegisterContentEvents();
    48       // Register your event handlers here
     63      foreach (TreeNode node in treeView.Nodes) {
     64        RegisterContentEvents((IItemTree)node.Tag, node);
     65      }
     66    }
     67
     68    private void RegisterContentEvents(IItemTree item, TreeNode node) {
     69      item.ItemsAdded += new CollectionItemsChangedEventHandler<IItemTree>(item_ItemsAdded);
     70      item.ItemsRemoved += new CollectionItemsChangedEventHandler<IItemTree>(item_ItemsRemoved);
     71      item.CollectionReset += new CollectionItemsChangedEventHandler<IItemTree>(item_CollectionReset);
     72      item.ToStringChanged += new System.EventHandler(item_ToStringChanged);
     73      item.ItemImageChanged += new EventHandler(item_ItemImageChanged);
     74      foreach (TreeNode childNode in node.Nodes) {
     75        RegisterContentEvents((IItemTree)childNode.Tag, childNode);
     76      }
    4977    }
    5078
     
    5785      if (Content == null) {
    5886        // Add code when content has been changed and is null
    59         treeView.Nodes.Clear();
     87        ClearNodes();
    6088      } else {
    6189        // Add code when content has been changed and is not null
    62         treeView.Nodes.Clear();
    63         AddChildNodes(Content, treeView.Nodes);
    64       }
    65     }
    66 
    67     private void AddChildNodes(IItemTree item, TreeNodeCollection nodes) {
    68       var node = CreateTreeViewNode(item);
     90        ClearNodes();
     91        AddChildNodes(Content, treeView.Nodes, false);
     92        foreach (TreeNode node in treeView.Nodes) {
     93          UpdateNodeItemImage(node);
     94        }
     95      }
     96    }
     97
     98    private void ClearNodes() {
     99      treeView.Nodes.Clear();
     100    }
     101
     102    private void AddChildNodes(IItemTree item, TreeNodeCollection nodes, bool registerEvents) {
     103      TreeNode node = CreateTreeViewNode(item);
    69104      nodes.Add(node);
    70       var childItems = item.GetChildNodes();
    71       foreach (var childItem in childItems) {       
    72         AddChildNodes(childItem, node.Nodes);
    73       }
     105      RebuildImageList(node);
     106      RegisterContentEvents(item, node);
     107      var childItems = item.GetChildItems();
     108      foreach (var childItem in childItems) {
     109        AddChildNodes(childItem, node.Nodes, registerEvents);
     110      }
     111      node.ExpandAll();
     112    }
     113
     114    private void RemoveChildNodes(IItemTree item, TreeNodeCollection treeNodeCollection) {
     115      int idx = -1;
     116      for (int i = 0; i < treeNodeCollection.Count; i++) {
     117        if (treeNodeCollection[i].Tag == item) {
     118          idx = i; break;
     119        }
     120      }
     121      DeregisterContentEvents(item, treeNodeCollection[idx]);
     122      treeNodeCollection.RemoveAt(idx);
     123    }
     124
     125    private void item_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IItemTree> e) {
     126      TreeNode node = GetNodeByItem(sender as IItemTree);
     127      foreach (IItemTree item in e.Items) {
     128        AddChildNodes(item, node.Nodes, true);
     129        node.ExpandAll();
     130        UpdateNodeItemImage(node);
     131      }
     132    }
     133
     134    private void item_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IItemTree> e) {
     135      TreeNode node = GetNodeByItem(sender as IItemTree);
     136      foreach (IItemTree item in e.Items) {
     137        RemoveChildNodes(item, node.Nodes);
     138      }
     139      RebuildImageList();
     140    }
     141
     142    private void item_CollectionReset(object sender, CollectionItemsChangedEventArgs<IItemTree> e) {
     143      TreeNode node = GetNodeByItem(sender as IItemTree);
     144      foreach (IItemTree item in e.OldItems) {
     145        RemoveChildNodes(item, node.Nodes);
     146      }
     147      RebuildImageList();
     148      foreach (IItemTree item in e.Items) {
     149        AddChildNodes(item, node.Nodes, true);
     150      }
     151    }
     152
     153    private void item_ToStringChanged(object sender, EventArgs e) {
     154      var item = sender as IItemTree;
     155      TreeNode node = GetNodeByItem(item);
     156      node.Text = item.ToString();
     157    }
     158
     159    private void item_ItemImageChanged(object sender, EventArgs e) {
     160      var item = sender as IItemTree;
     161      TreeNode node = GetNodeByItem(item);
     162      UpdateNodeItemImage(node);
     163    }
     164
     165    private TreeNode GetNodeByItem(IItemTree item) {
     166      TreeNode found = null;
     167      foreach (TreeNode node in treeView.Nodes) {
     168        found = GetNodeByItem(node, item);
     169        if (found != null)
     170          return found;
     171      }
     172      return null;
     173    }
     174
     175    private TreeNode GetNodeByItem(TreeNode node, IItemTree item) {
     176      if (node.Tag == item)
     177        return node;
     178      TreeNode found = null;
     179      foreach (TreeNode childNode in node.Nodes) {
     180        found = GetNodeByItem(childNode, item);
     181        if (found != null)
     182          return found;
     183      }
     184      return null;
    74185    }
    75186
     
    77188      var node = new TreeNode(item.ToString());
    78189      node.Tag = item;
    79       if (!treeView.ImageList.Images.ContainsKey(item.ItemImage.GetHashCode().ToString())) {
    80         treeView.ImageList.Images.Add(item.ItemImage.GetHashCode().ToString(), item.ItemImage);
    81       }
    82       node.ImageKey = item.ItemImage.GetHashCode().ToString();
    83190      return node;
     191    }
     192
     193    private void UpdateNodeItemImage(TreeNode node) {
     194      if (node == null) throw new ArgumentNullException();
     195      var item = node.Tag as IItemTree;
     196      int i = node.ImageIndex;
     197      this.imageList.Images[i] = item == null ? HeuristicLab.Common.Resources.VSImageLibrary.Nothing : item.ItemImage;
     198      node.ImageIndex = -1;
     199      node.ImageIndex = i;
     200      node.SelectedImageIndex = node.ImageIndex;
     201      foreach (TreeNode childNode in node.Nodes) {
     202        UpdateNodeItemImage(childNode);
     203      }
    84204    }
    85205
     
    96216    #endregion
    97217
    98 
     218    private void RebuildImageList() {
     219      treeView.ImageList.Images.Clear();
     220      foreach (TreeNode node in treeView.Nodes) {
     221        RebuildImageList(node);
     222      }
     223    }
     224
     225    private void RebuildImageList(TreeNode node) {
     226      var item = node.Tag as IItemTree;
     227      treeView.ImageList.Images.Add(item == null ? HeuristicLab.Common.Resources.VSImageLibrary.Nothing : item.ItemImage);
     228      node.ImageIndex = treeView.ImageList.Images.Count - 1;
     229      node.SelectedImageIndex = node.ImageIndex;
     230      foreach (TreeNode childNode in node.Nodes) {
     231        RebuildImageList(childNode);
     232      }
     233    }
    99234  }
    100235}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/ItemTreeView.designer.cs

    r5637 r5675  
    2727      this.splitContainer = new System.Windows.Forms.SplitContainer();
    2828      this.treeView = new System.Windows.Forms.TreeView();
     29      this.imageList = new System.Windows.Forms.ImageList(this.components);
     30      this.detailsGroupBox = new System.Windows.Forms.GroupBox();
    2931      this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    30       this.imageList = new System.Windows.Forms.ImageList(this.components);
    3132      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
    3233      this.splitContainer.Panel1.SuspendLayout();
    3334      this.splitContainer.Panel2.SuspendLayout();
    3435      this.splitContainer.SuspendLayout();
     36      this.detailsGroupBox.SuspendLayout();
    3537      this.SuspendLayout();
    3638      //
     
    3840      //
    3941      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
     42      this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
    4043      this.splitContainer.Location = new System.Drawing.Point(0, 0);
    4144      this.splitContainer.Name = "splitContainer";
     
    4750      // splitContainer.Panel2
    4851      //
    49       this.splitContainer.Panel2.Controls.Add(this.viewHost);
    50       this.splitContainer.Size = new System.Drawing.Size(551, 463);
    51       this.splitContainer.SplitterDistance = 183;
     52      this.splitContainer.Panel2.Controls.Add(this.detailsGroupBox);
     53      this.splitContainer.Size = new System.Drawing.Size(624, 463);
     54      this.splitContainer.SplitterDistance = 200;
    5255      this.splitContainer.TabIndex = 0;
    5356      //
     
    6063      this.treeView.Name = "treeView";
    6164      this.treeView.SelectedImageIndex = 0;
    62       this.treeView.Size = new System.Drawing.Size(183, 463);
     65      this.treeView.Size = new System.Drawing.Size(200, 463);
    6366      this.treeView.TabIndex = 0;
    6467      this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_AfterSelect);
     68      //
     69      // imageList
     70      //
     71      this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     72      this.imageList.ImageSize = new System.Drawing.Size(16, 16);
     73      this.imageList.TransparentColor = System.Drawing.Color.Transparent;
     74      //
     75      // detailsGroupBox
     76      //
     77      this.detailsGroupBox.Controls.Add(this.viewHost);
     78      this.detailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
     79      this.detailsGroupBox.Location = new System.Drawing.Point(0, 0);
     80      this.detailsGroupBox.Name = "detailsGroupBox";
     81      this.detailsGroupBox.Size = new System.Drawing.Size(420, 463);
     82      this.detailsGroupBox.TabIndex = 1;
     83      this.detailsGroupBox.TabStop = false;
     84      this.detailsGroupBox.Text = "Details";
    6585      //
    6686      // viewHost
     
    7090      this.viewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    7191      this.viewHost.Enabled = false;
    72       this.viewHost.Location = new System.Drawing.Point(0, 0);
     92      this.viewHost.Location = new System.Drawing.Point(3, 16);
    7393      this.viewHost.Name = "viewHost";
    7494      this.viewHost.ReadOnly = false;
    75       this.viewHost.Size = new System.Drawing.Size(364, 463);
     95      this.viewHost.Size = new System.Drawing.Size(414, 444);
    7696      this.viewHost.TabIndex = 0;
    7797      this.viewHost.ViewsLabelVisible = true;
    7898      this.viewHost.ViewType = null;
    79       //
    80       // imageList
    81       //
    82       this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
    83       this.imageList.ImageSize = new System.Drawing.Size(16, 16);
    84       this.imageList.TransparentColor = System.Drawing.Color.Transparent;
    8599      //
    86100      // ItemTreeView
     
    89103      this.Controls.Add(this.splitContainer);
    90104      this.Name = "ItemTreeView";
    91       this.Size = new System.Drawing.Size(551, 463);
     105      this.Size = new System.Drawing.Size(624, 463);
    92106      this.splitContainer.Panel1.ResumeLayout(false);
    93107      this.splitContainer.Panel2.ResumeLayout(false);
    94108      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
    95109      this.splitContainer.ResumeLayout(false);
     110      this.detailsGroupBox.ResumeLayout(false);
    96111      this.ResumeLayout(false);
    97112
     
    104119    private MainForm.WindowsForms.ViewHost viewHost;
    105120    private System.Windows.Forms.ImageList imageList;
     121    private System.Windows.Forms.GroupBox detailsGroupBox;
    106122  }
    107123}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentClient.cs

    r5637 r5675  
    3333  using System.Configuration;
    3434  using System.IO;
     35  using HeuristicLab.Collections;
    3536  using HeuristicLab.PluginInfrastructure;
    3637
     
    773774
    774775    #region IItemTree Members
    775     public IEnumerable<IItemTree> GetChildNodes() {
    776       return new List<HiveJob> { hiveJob };
    777     }
     776    public IObservableCollection<IItemTree> GetChildItems() {
     777      return new ObservableCollection<IItemTree> { hiveJob };
     778    }
     779    IEnumerable<IItemTree> IItemTree.GetChildItems() {
     780      return this.GetChildItems();
     781    }
     782    #endregion
     783
     784    #region INotifyObservableCollectionItemsChanged<IItemTree> Members
     785    public event CollectionItemsChangedEventHandler<IItemTree> CollectionReset;
     786    public event CollectionItemsChangedEventHandler<IItemTree> ItemsAdded;
     787    public event CollectionItemsChangedEventHandler<IItemTree> ItemsRemoved;
    778788    #endregion
    779789  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveJobClient.cs

    r5637 r5675  
    111111      this.childHiveJobs = new ItemList<HiveJob>();
    112112      syncJobsWithOptimizers = true;
     113      RegisterChildHiveJobEvents();
    113114    }
    114115
     
    136137      this.childHiveJobs = new ItemList<HiveJob>();
    137138      this.syncJobsWithOptimizers = true;
     139      RegisterChildHiveJobEvents();
    138140    }
    139141
     
    209211    }
    210212
     213    private void RegisterChildHiveJobEvents() {
     214      this.childHiveJobs.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnItemsAdded);
     215      this.childHiveJobs.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnItemsRemoved);
     216      this.childHiveJobs.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnCollectionReset);
     217    }
     218    private void DeregisterChildHiveJobEvents() {
     219      this.childHiveJobs.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnItemsAdded);
     220      this.childHiveJobs.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnItemsRemoved);
     221      this.childHiveJobs.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnCollectionReset);
     222    }
     223
    211224    private void batchRun_OptimizerChanged(object sender, EventArgs e) {
    212225      if (syncJobsWithOptimizers) {
     
    566579    }
    567580
    568     public IEnumerable<IItemTree> GetChildNodes() {
    569       return this.ChildHiveJobs;
    570     }
     581    public IEnumerable<IItemTree> GetChildItems() {
     582      return this.childHiveJobs;
     583    }
     584
     585    #region INotifyObservableCollectionItemsChanged<IItemTree> Members
     586
     587    public event CollectionItemsChangedEventHandler<IItemTree> CollectionReset;
     588    private void OnCollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) {
     589      var handler = CollectionReset;
     590      if (handler != null) handler(this, ToCollectionItemsChangedEventArgs(e));
     591    }
     592
     593    public event CollectionItemsChangedEventHandler<IItemTree> ItemsAdded;
     594    private void OnItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) {
     595      var handler = ItemsAdded;
     596      if (handler != null) handler(this, ToCollectionItemsChangedEventArgs(e));
     597    }
     598
     599    public event CollectionItemsChangedEventHandler<IItemTree> ItemsRemoved;
     600    private void OnItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) {
     601      var handler = ItemsRemoved;
     602      if (handler != null) handler(this, ToCollectionItemsChangedEventArgs(e));
     603    }
     604
     605    private static CollectionItemsChangedEventArgs<IItemTree> ToCollectionItemsChangedEventArgs(CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) {
     606      return new CollectionItemsChangedEventArgs<IItemTree>(e.Items.Select(x => x.Value), e.OldItems == null ? null : e.OldItems.Select(x => x.Value));
     607    }
     608    #endregion
    571609  }
    572610}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/IItemTree.cs

    r5637 r5675  
    11using System.Collections.Generic;
     2using HeuristicLab.Collections;
    23using HeuristicLab.Core;
    34
    45namespace HeuristicLab.Clients.Hive {
    5   public interface IItemTree : INamedItem {
    6     IEnumerable<IItemTree> GetChildNodes();
     6  public interface IItemTree : INamedItem, INotifyObservableCollectionItemsChanged<IItemTree> {
     7    IEnumerable<IItemTree> GetChildItems();
    78  }
    89}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Hive 3.4.sln

    r5593 r5675  
    7676EndProject
    7777Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Clients.Hive.LifecycleClient", "HeuristicLab.Clients.Hive.LifecycleClient\HeuristicLab.Clients.Hive.LifecycleClient.csproj", "{54491B6A-1EDD-4C76-90A7-338BA9C1FBF8}"
     78EndProject
     79Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsTestProject", "WindowsFormsTestProject\WindowsFormsTestProject.csproj", "{BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}"
    7880EndProject
    7981Global
     
    341343    {54491B6A-1EDD-4C76-90A7-338BA9C1FBF8}.Release|x86.ActiveCfg = Release|x86
    342344    {54491B6A-1EDD-4C76-90A7-338BA9C1FBF8}.Release|x86.Build.0 = Release|x86
     345    {BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     346    {BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
     347    {BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
     348    {BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}.Debug|Mixed Platforms.Build.0 = Debug|x86
     349    {BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}.Debug|x64.ActiveCfg = Debug|x86
     350    {BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}.Debug|x86.ActiveCfg = Debug|x86
     351    {BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}.Debug|x86.Build.0 = Debug|x86
     352    {BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}.Release|Any CPU.ActiveCfg = Release|x86
     353    {BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}.Release|Mixed Platforms.ActiveCfg = Release|x86
     354    {BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}.Release|Mixed Platforms.Build.0 = Release|x86
     355    {BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}.Release|x64.ActiveCfg = Release|x86
     356    {BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}.Release|x86.ActiveCfg = Release|x86
     357    {BEB9D81C-3878-4F2E-BBAF-5B24AA90AEEE}.Release|x86.Build.0 = Release|x86
    343358  EndGlobalSection
    344359  GlobalSection(SolutionProperties) = preSolution
Note: See TracChangeset for help on using the changeset viewer.