Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/16/10 19:26:24 (14 years ago)
Author:
swagner
Message:

Enabled saving only for some specific items (#1193)

Location:
trunk/sources/HeuristicLab.Core/3.3
Files:
17 edited

Legend:

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

    r4068 r4419  
    3333  [Item("ItemArray", "Represents an array of items.")]
    3434  public class ItemArray<T> : ObservableArray<T>, IItemArray<T> where T : class, IItem {
    35     private string filename;
    36     public string Filename {
    37       get { return filename; }
    38       set {
    39         if (value == null) throw new ArgumentNullException();
    40         if ((filename == null) || !filename.Equals(value)) {
    41           filename = value;
    42           OnFilenameChanged();
    43         }
    44       }
    45     }
    46 
    4735    public virtual string ItemName {
    4836      get { return ItemAttribute.GetName(this.GetType()); }
     
    8371    }
    8472
    85     public event EventHandler FilenameChanged;
    86     protected virtual void OnFilenameChanged() {
    87       EventHandler handler = FilenameChanged;
    88       if (handler != null) handler(this, EventArgs.Empty);
    89     }
    9073    public event EventHandler ItemImageChanged;
    9174    protected virtual void OnItemImageChanged() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ItemCollection.cs

    r3822 r4419  
    3333  [Item("ItemCollection", "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 (value == null) throw new ArgumentNullException();
    40         if ((filename == null) || !filename.Equals(value)) {
    41           filename = value;
    42           OnFilenameChanged();
    43         }
    44       }
    45     }
    46 
    4735    public virtual string ItemName {
    4836      get { return ItemAttribute.GetName(this.GetType()); }
     
    8270    }
    8371
    84     public event EventHandler FilenameChanged;
    85     protected virtual void OnFilenameChanged() {
    86       EventHandler handler = FilenameChanged;
    87       if (handler != null) handler(this, EventArgs.Empty);
    88     }
    8972    public event EventHandler ItemImageChanged;
    9073    protected virtual void OnItemImageChanged() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ItemDictionary.cs

    r4068 r4419  
    3434    where TKey : class, IItem
    3535    where TValue : class, IItem {
    36     private string filename;
    37     public string Filename {
    38       get { return filename; }
    39       set {
    40         if (value == null) throw new ArgumentNullException();
    41         if ((filename == null) || !filename.Equals(value)) {
    42           filename = value;
    43           OnFilenameChanged();
    44         }
    45       }
    46     }
    4736
    4837    public virtual string ItemName {
     
    8473    }
    8574
    86     public event EventHandler FilenameChanged;
    87     protected virtual void OnFilenameChanged() {
    88       EventHandler handler = FilenameChanged;
    89       if (handler != null) handler(this, EventArgs.Empty);
    90     }
    9175    public event EventHandler ItemImageChanged;
    9276    protected virtual void OnItemImageChanged() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ItemList.cs

    r4068 r4419  
    3333  [Item("ItemList", "Represents a list of items.")]
    3434  public class ItemList<T> : ObservableList<T>, IItemList<T> where T : class, IItem {
    35     private string filename;
    36     public string Filename {
    37       get { return filename; }
    38       set {
    39         if (value == null) throw new ArgumentNullException();
    40         if ((filename == null) || !filename.Equals(value)) {
    41           filename = value;
    42           OnFilenameChanged();
    43         }
    44       }
    45     }
    46 
    4735    public virtual string ItemName {
    4836      get { return ItemAttribute.GetName(this.GetType()); }
     
    8270    }
    8371
    84     public event EventHandler FilenameChanged;
    85     protected virtual void OnFilenameChanged() {
    86       EventHandler handler = FilenameChanged;
    87       if (handler != null) handler(this, EventArgs.Empty);
    88     }
    8972    public event EventHandler ItemImageChanged;
    9073    protected virtual void OnItemImageChanged() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ItemSet.cs

    r4068 r4419  
    3333  [Item("ItemSet", "Represents a set of items.")]
    3434  public class ItemSet<T> : ObservableSet<T>, IItemSet<T> where T : class, IItem {
    35     private string filename;
    36     public string Filename {
    37       get { return filename; }
    38       set {
    39         if (value == null) throw new ArgumentNullException();
    40         if ((filename == null) || !filename.Equals(value)) {
    41           filename = value;
    42           OnFilenameChanged();
    43         }
    44       }
    45     }
    46 
    4735    public virtual string ItemName {
    4836      get { return ItemAttribute.GetName(this.GetType()); }
     
    8169    }
    8270
    83     public event EventHandler FilenameChanged;
    84     protected virtual void OnFilenameChanged() {
    85       EventHandler handler = FilenameChanged;
    86       if (handler != null) handler(this, EventArgs.Empty);
    87     }
    8871    public event EventHandler ItemImageChanged;
    8972    protected virtual void OnItemImageChanged() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/KeyedItemCollection.cs

    r4068 r4419  
    3131  [StorableClass]
    3232  public abstract class KeyedItemCollection<TKey, TItem> : ObservableKeyedCollection<TKey, TItem>, IKeyedItemCollection<TKey, TItem> where TItem : class, IItem {
    33     private string filename;
    34     public string Filename {
    35       get { return filename; }
    36       set {
    37         if (value == null) throw new ArgumentNullException();
    38         if ((filename == null) || !filename.Equals(value)) {
    39           filename = value;
    40           OnFilenameChanged();
    41         }
    42       }
    43     }
    44 
    4533    public virtual string ItemName {
    4634      get { return ItemAttribute.GetName(this.GetType()); }
     
    8371    }
    8472
    85     public event EventHandler FilenameChanged;
    86     protected virtual void OnFilenameChanged() {
    87       EventHandler handler = FilenameChanged;
    88       if (handler != null) handler(this, EventArgs.Empty);
    89     }
    9073    public event EventHandler ItemImageChanged;
    9174    protected virtual void OnItemImageChanged() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/OperatorCollection.cs

    r4068 r4419  
    2525namespace HeuristicLab.Core {
    2626  [StorableClass]
    27   [Creatable("Algorithm Design")]
    2827  [Item("Operator Collection", "Represents a collection of operators.")]
    2928  public class OperatorCollection : ItemCollection<IOperator> {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ReadOnlyItemArray.cs

    r4068 r4419  
    3131  [Item("ReadOnlyItemArray", "Represents a read-only array of items.")]
    3232  public class ReadOnlyItemArray<T> : ReadOnlyObservableArray<T>, IItemArray<T> where T : class, IItem {
    33     private string filename;
    34     public string Filename {
    35       get { return filename; }
    36       set {
    37         if (value == null) throw new ArgumentNullException();
    38         if ((filename == null) || !filename.Equals(value)) {
    39           filename = value;
    40           OnFilenameChanged();
    41         }
    42       }
    43     }
    44 
    4533    public virtual string ItemName {
    4634      get { return ItemAttribute.GetName(this.GetType()); }
     
    7664    }
    7765
    78     public event EventHandler FilenameChanged;
    79     protected virtual void OnFilenameChanged() {
    80       EventHandler handler = FilenameChanged;
    81       if (handler != null) handler(this, EventArgs.Empty);
    82     }
    8366    public event EventHandler ItemImageChanged;
    8467    protected virtual void OnItemImageChanged() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ReadOnlyItemCollection.cs

    r4068 r4419  
    3131  [Item("ReadOnlyItemCollection", "Represents a read-only collection of items.")]
    3232  public class ReadOnlyItemCollection<T> : ReadOnlyObservableCollection<T>, IItemCollection<T> where T : class, IItem {
    33     private string filename;
    34     public string Filename {
    35       get { return filename; }
    36       set {
    37         if (value == null) throw new ArgumentNullException();
    38         if ((filename == null) || !filename.Equals(value)) {
    39           filename = value;
    40           OnFilenameChanged();
    41         }
    42       }
    43     }
    44 
    4533    public virtual string ItemName {
    4634      get { return ItemAttribute.GetName(this.GetType()); }
     
    7664    }
    7765
    78     public event EventHandler FilenameChanged;
    79     protected virtual void OnFilenameChanged() {
    80       EventHandler handler = FilenameChanged;
    81       if (handler != null) handler(this, EventArgs.Empty);
    82     }
    8366    public event EventHandler ItemImageChanged;
    8467    protected virtual void OnItemImageChanged() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ReadOnlyItemDictionary.cs

    r4068 r4419  
    3333    where TKey : class, IItem
    3434    where TValue : class, IItem {
    35     private string filename;
    36     public string Filename {
    37       get { return filename; }
    38       set {
    39         if (value == null) throw new ArgumentNullException();
    40         if ((filename == null) || !filename.Equals(value)) {
    41           filename = value;
    42           OnFilenameChanged();
    43         }
    44       }
    45     }
    4635
    4736    public virtual string ItemName {
     
    7867    }
    7968
    80     public event EventHandler FilenameChanged;
    81     protected virtual void OnFilenameChanged() {
    82       EventHandler handler = FilenameChanged;
    83       if (handler != null) handler(this, EventArgs.Empty);
    84     }
    8569    public event EventHandler ItemImageChanged;
    8670    protected virtual void OnItemImageChanged() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ReadOnlyItemList.cs

    r4068 r4419  
    3131  [Item("ReadOnlyItemList", "Represents a read-only list of items.")]
    3232  public class ReadOnlyItemList<T> : ReadOnlyObservableList<T>, IItemList<T> where T : class, IItem {
    33     private string filename;
    34     public string Filename {
    35       get { return filename; }
    36       set {
    37         if (value == null) throw new ArgumentNullException();
    38         if ((filename == null) || !filename.Equals(value)) {
    39           filename = value;
    40           OnFilenameChanged();
    41         }
    42       }
    43     }
    44 
    4533    public virtual string ItemName {
    4634      get { return ItemAttribute.GetName(this.GetType()); }
     
    7664    }
    7765
    78     public event EventHandler FilenameChanged;
    79     protected virtual void OnFilenameChanged() {
    80       EventHandler handler = FilenameChanged;
    81       if (handler != null) handler(this, EventArgs.Empty);
    82     }
    8366    public event EventHandler ItemImageChanged;
    8467    protected virtual void OnItemImageChanged() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ReadOnlyItemSet.cs

    r4068 r4419  
    3131  [Item("ReadOnlyItemSet", "Represents a read-only set of items.")]
    3232  public class ReadOnlyItemSet<T> : ReadOnlyObservableSet<T>, IItemSet<T> where T : class, IItem {
    33     private string filename;
    34     public string Filename {
    35       get { return filename; }
    36       set {
    37         if (value == null) throw new ArgumentNullException();
    38         if ((filename == null) || !filename.Equals(value)) {
    39           filename = value;
    40           OnFilenameChanged();
    41         }
    42       }
    43     }
    44 
    4533    public virtual string ItemName {
    4634      get { return ItemAttribute.GetName(this.GetType()); }
     
    7664    }
    7765
    78     public event EventHandler FilenameChanged;
    79     protected virtual void OnFilenameChanged() {
    80       EventHandler handler = FilenameChanged;
    81       if (handler != null) handler(this, EventArgs.Empty);
    82     }
    8366    public event EventHandler ItemImageChanged;
    8467    protected virtual void OnItemImageChanged() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ReadOnlyKeyedItemCollection.cs

    r4068 r4419  
    3131  [Item("ReadOnlyKeyedItemCollection", "Represents a read-only keyed collection of items.")]
    3232  public class ReadOnlyKeyedItemCollection<TKey, TItem> : ReadOnlyObservableKeyedCollection<TKey, TItem>, IKeyedItemCollection<TKey, TItem> where TItem : class, IItem {
    33     private string filename;
    34     public string Filename {
    35       get { return filename; }
    36       set {
    37         if (value == null) throw new ArgumentNullException();
    38         if ((filename == null) || !filename.Equals(value)) {
    39           filename = value;
    40           OnFilenameChanged();
    41         }
    42       }
    43     }
    44 
    4533    public virtual string ItemName {
    4634      get { return ItemAttribute.GetName(this.GetType()); }
     
    7664    }
    7765
    78     public event EventHandler FilenameChanged;
    79     protected virtual void OnFilenameChanged() {
    80       EventHandler handler = FilenameChanged;
    81       if (handler != null) handler(this, EventArgs.Empty);
    82     }
    8366    public event EventHandler ItemImageChanged;
    8467    protected virtual void OnItemImageChanged() {
  • trunk/sources/HeuristicLab.Core/3.3/Interfaces/IItem.cs

    r3728 r4419  
    2828  /// Interface to represent (almost) every HeuristicLab object (an object, an operator,...).
    2929  /// </summary>
    30   public interface IItem : IStorableContent {
     30  public interface IItem : IContent, IDeepCloneable {
    3131    string ItemName { get; }
    3232    string ItemDescription { get; }
  • trunk/sources/HeuristicLab.Core/3.3/Item.cs

    r3728 r4419  
    3232  [Item("Item", "Base class for all HeuristicLab items.")]
    3333  public abstract class Item : IItem {
    34     private string filename;
    35     public string Filename {
    36       get { return filename; }
    37       set {
    38         if (value == null) throw new ArgumentNullException();
    39         if ((filename == null) || !filename.Equals(value)) {
    40           filename = value;
    41           OnFilenameChanged();
    42         }
    43       }
    44     }
    45 
    4634    public virtual string ItemName {
    4735      get { return ItemAttribute.GetName(this.GetType()); }
     
    5745    }
    5846
    59     protected Item() {
    60       filename = string.Empty;
    61     }
     47    protected Item() { }
    6248    [StorableConstructor]
    63     protected Item(bool deserializing) {
    64       filename = string.Empty;
    65     }
     49    protected Item(bool deserializing) { }
    6650
    6751    public object Clone() {
     
    8266    }
    8367
    84     public event EventHandler FilenameChanged;
    85     protected virtual void OnFilenameChanged() {
    86       EventHandler handler = FilenameChanged;
    87       if (handler != null) handler(this, EventArgs.Empty);
    88     }
    8968    public event EventHandler ItemImageChanged;
    9069    protected virtual void OnItemImageChanged() {
  • trunk/sources/HeuristicLab.Core/3.3/Log.cs

    r3758 r4419  
    3030  [Item("Log", "A log for logging string messages.")]
    3131  [StorableClass]
    32   public class Log : Item, ILog {
     32  public class Log : Item, ILog, IStorableContent {
     33    public string Filename { get; set; }
     34
    3335    public override Image ItemImage {
    3436      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.File; }
  • trunk/sources/HeuristicLab.Core/3.3/OperatorGraph.cs

    r4068 r4419  
    3131  /// </summary>
    3232  [Item("Operator Graph", "Represents a graph of operators.")]
    33   [Creatable("Algorithm Design")]
    3433  [StorableClass]
    35   public class OperatorGraph : Item {
     34  public class OperatorGraph : Item, IStorableContent {
     35    public string Filename { get; set; }
     36
    3637    [Storable]
    3738    private OperatorSet operators;
Note: See TracChangeset for help on using the changeset viewer.