Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/04/12 15:42:21 (12 years ago)
Author:
mkommend
Message:

#1673: Added new property AlgorithmName to the RunCollection and synced the property with the name of the surrounding IOptimizer. The AlgorithmName is used by the RunCollectionViews as prefix for its caption if it was set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionDataTableView.cs

    r8108 r8738  
    6363      Content.CollectionReset += new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
    6464      Content.UpdateOfRunsInProgressChanged += new EventHandler(Content_UpdateOfRunsInProgressChanged);
     65      Content.AlgorithmNameChanged += new EventHandler(Content_AlgorithmNameChanged);
    6566    }
    6667    protected override void DeregisterContentEvents() {
     
    6970      Content.CollectionReset -= new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);
    7071      Content.UpdateOfRunsInProgressChanged -= new EventHandler(Content_UpdateOfRunsInProgressChanged);
     72      Content.AlgorithmNameChanged -= new EventHandler(Content_AlgorithmNameChanged);
    7173      base.DeregisterContentEvents();
    7274    }
     
    9395      RemoveRuns(e.OldItems);
    9496      AddRuns(e.Items);
     97    }
     98    private void Content_AlgorithmNameChanged(object sender, EventArgs e) {
     99      if (InvokeRequired)
     100        Invoke(new EventHandler(Content_AlgorithmNameChanged), sender, e);
     101      else UpdateCaption();
    95102    }
    96103    private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) {
     
    123130      runMapping.Clear();
    124131
     132      UpdateCaption();
    125133      if (Content != null) {
    126134        UpdateDataTableComboBox();
     
    195203    }
    196204
     205    private void UpdateCaption() {
     206      Caption = Content != null ? Content.AlgorithmName + "Data Table" : ViewAttribute.GetViewName(GetType());
     207    }
     208
    197209    private void UpdateDataRowComboBox() {
    198210      dataRowComboBox.Items.Clear();
Note: See TracChangeset for help on using the changeset viewer.