Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/04/14 18:35:25 (10 years ago)
Author:
abeham
Message:

#2120: merged to stable

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Clients.OKB/3.3/RunCreation/OKBRun.cs

    r11170 r11522  
    2222using System;
    2323using System.Collections.Generic;
     24using System.ComponentModel;
    2425using System.Drawing;
    2526using System.IO;
    2627using HeuristicLab.Clients.Access;
     28using HeuristicLab.Collections;
    2729using HeuristicLab.Common;
    2830using HeuristicLab.Core;
     
    5153        if (value != stored) {
    5254          stored = value;
    53           OnStoredChanged();
     55          OnPropertyChanged("Stored");
    5456          OnItemImageChanged();
    5557        }
     
    6062      get { return WrappedItem.Algorithm; }
    6163    }
    62     public IDictionary<string, IItem> Parameters {
     64    public IObservableDictionary<string, IItem> Parameters {
    6365      get { return WrappedItem.Parameters; }
    6466    }
    65     public IDictionary<string, IItem> Results {
     67    public IObservableDictionary<string, IItem> Results {
    6668      get { return WrappedItem.Results; }
    6769    }
     
    162164
    163165    #region Events
    164     public event EventHandler Changed;
    165     private void OnChanged() {
    166       var handler = Changed;
    167       if (handler != null) handler(this, EventArgs.Empty);
    168     }
    169     public event EventHandler StoredChanged;
    170     private void OnStoredChanged() {
    171       var handler = StoredChanged;
    172       if (handler != null) handler(this, EventArgs.Empty);
     166    public event PropertyChangedEventHandler PropertyChanged;
     167    private void OnPropertyChanged(string property) {
     168      var handler = PropertyChanged;
     169      if (handler != null) handler(this, new PropertyChangedEventArgs(property));
    173170    }
    174171
    175172    protected override void RegisterWrappedItemEvents() {
    176173      base.RegisterWrappedItemEvents();
    177       WrappedItem.Changed += new EventHandler(WrappedItem_Changed);
     174      WrappedItem.PropertyChanged += WrappedItem_PropertyChanged;
    178175    }
    179176    protected override void DeregisterWrappedItemEvents() {
    180       WrappedItem.Changed -= new EventHandler(WrappedItem_Changed);
     177      WrappedItem.PropertyChanged -= WrappedItem_PropertyChanged;
    181178      base.DeregisterWrappedItemEvents();
    182179    }
    183180
    184     private void WrappedItem_Changed(object sender, EventArgs e) {
    185       OnChanged();
     181    private void WrappedItem_PropertyChanged(object sender, PropertyChangedEventArgs e) {
     182      OnPropertyChanged(e.PropertyName);
    186183    }
    187184    #endregion
Note: See TracChangeset for help on using the changeset viewer.