Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/22/10 05:14:39 (15 years ago)
Author:
swagner
Message:

Worked on the refactoring of saving and loading items (#990)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ItemCollection.cs

    r3431 r3483  
    3333  [Item("ItemCollection<T>", "Represents a collection of items.")]
    3434  public class ItemCollection<T> : ObservableCollection<T>, IItemCollection<T> where T : class, IItem {
     35    private string filename;
     36    public string Filename {
     37      get { return filename; }
     38      set {
     39        if (!filename.Equals(value)) {
     40          filename = value;
     41          OnFilenameChanged();
     42        }
     43      }
     44    }
     45
    3546    public virtual string ItemName {
    3647      get { return ItemAttribute.GetName(this.GetType()); }
     
    7384    }
    7485
     86    public event EventHandler FilenameChanged;
     87    protected virtual void OnFilenameChanged() {
     88      EventHandler handler = FilenameChanged;
     89      if (handler != null) handler(this, EventArgs.Empty);
     90    }
    7591    public event EventHandler ItemImageChanged;
    7692    protected virtual void OnItemImageChanged() {
Note: See TracChangeset for help on using the changeset viewer.