Changeset 3351


Ignore:
Timestamp:
04/15/10 04:37:36 (11 years ago)
Author:
swagner
Message:

Implemented reviewers' comments (#893).

Location:
trunk/sources
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/Clipboard.Designer.cs

    r3299 r3351  
    1919 */
    2020#endregion
     21
     22using System;
     23using System.Windows.Forms;
    2124
    2225namespace HeuristicLab.Core.Views {
     
    3437      if (disposing) {
    3538        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
     39        foreach (ListViewItem item in listView.Items) {
     40          ((T)item.Tag).ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
     41          ((T)item.Tag).ToStringChanged -= new EventHandler(Item_ToStringChanged);
     42        }
    3643        if (components != null) components.Dispose();
    3744      }
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.Designer.cs

    r3341 r3351  
    3838        foreach (ListViewItem listViewItem in itemsListView.Items) {
    3939          T item = listViewItem.Tag as T;
     40          if (item != null) item.ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
    4041          if (item != null) item.ToStringChanged -= new EventHandler(Item_ToStringChanged);
    4142        }
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.Designer.cs

    r3281 r3351  
    3737    protected override void Dispose(bool disposing) {
    3838      if (disposing) {
    39         foreach (ListViewItem item in itemsListView.Items)
     39        foreach (ListViewItem item in itemsListView.Items) {
     40          ((T)item.Tag).ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
    4041          ((T)item.Tag).ToStringChanged -= new EventHandler(Item_ToStringChanged);
     42        }
    4143        if (components != null) components.Dispose();
    4244      }
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.Designer.cs

    r3281 r3351  
    3636    protected override void Dispose(bool disposing) {
    3737      if (disposing) {
    38         foreach (ListViewItem item in itemsListView.Items)
     38        foreach (ListViewItem item in itemsListView.Items) {
     39          ((T)item.Tag).ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
    3940          ((T)item.Tag).ToStringChanged -= new EventHandler(Item_ToStringChanged);
     41        }
    4042        if (components != null) components.Dispose();
    4143      }
  • trunk/sources/HeuristicLab.Core/3.3/Executable.cs

    r3289 r3351  
    3030  public abstract class Executable : Item, IExecutable {
    3131    public override Image ItemImage {
    32       get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event; }
     32      get {
     33        if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event;
     34        else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Play;
     35        else if (ExecutionState == ExecutionState.Paused) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Pause;
     36        else if (ExecutionState == ExecutionState.Stopped) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Stop;
     37        else return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event;
     38      }
    3339    }
    3440
     
    4147          executionState = value;
    4248          OnExecutionStateChanged();
     49          OnItemImageChanged();
    4350        }
    4451      }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.Designer.cs

    r3281 r3351  
    3737    protected override void Dispose(bool disposing) {
    3838      if (disposing) {
    39         foreach (ListViewItem item in itemsListView.Items)
     39        foreach (ListViewItem item in itemsListView.Items) {
     40          ((IRun)item.Tag).ItemImageChanged -= new EventHandler(Item_ItemImageChanged);
    4041          ((IRun)item.Tag).ToStringChanged -= new EventHandler(Item_ToStringChanged);
     42        }
    4143        if (components != null) components.Dispose();
    4244      }
  • trunk/sources/HeuristicLab.Optimization/3.3/Algorithm.cs

    r3286 r3351  
    3535  public abstract class Algorithm : ParameterizedNamedItem, IAlgorithm {
    3636    public override Image ItemImage {
    37       get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event; }
     37      get {
     38        if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event;
     39        else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Play;
     40        else if (ExecutionState == ExecutionState.Paused) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Pause;
     41        else if (ExecutionState == ExecutionState.Stopped) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Stop;
     42        else return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event;
     43      }
    3844    }
    3945
     
    4652          executionState = value;
    4753          OnExecutionStateChanged();
     54          OnItemImageChanged();
    4855        }
    4956      }
  • trunk/sources/HeuristicLab.Optimization/3.3/BatchRun.cs

    r3280 r3351  
    3636  public sealed class BatchRun : NamedItem, IOptimizer {
    3737    public override Image ItemImage {
    38       get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event; }
     38      get {
     39        if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event;
     40        else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Play;
     41        else if (ExecutionState == ExecutionState.Paused) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Pause;
     42        else if (ExecutionState == ExecutionState.Stopped) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Stop;
     43        else return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event;
     44      }
    3945    }
    4046
     
    4753          executionState = value;
    4854          OnExecutionStateChanged();
     55          OnItemImageChanged();
    4956        }
    5057      }
  • trunk/sources/HeuristicLab.Optimization/3.3/Experiment.cs

    r3280 r3351  
    3737  public sealed class Experiment : NamedItem, IOptimizer {
    3838    public override Image ItemImage {
    39       get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event; }
     39      get {
     40        if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event;
     41        else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Play;
     42        else if (ExecutionState == ExecutionState.Paused) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Pause;
     43        else if (ExecutionState == ExecutionState.Stopped) return HeuristicLab.Common.Resources.VS2008ImageLibrary.Stop;
     44        else return HeuristicLab.Common.Resources.VS2008ImageLibrary.Event;
     45      }
    4046    }
    4147
     
    4854          executionState = value;
    4955          OnExecutionStateChanged();
     56          OnItemImageChanged();
    5057        }
    5158      }
Note: See TracChangeset for help on using the changeset viewer.