Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3002


Ignore:
Timestamp:
03/11/10 10:55:48 (15 years ago)
Author:
epitzer
Message:

Add missing constructors and hooks (#548)

Location:
trunk/sources
Files:
8 edited

Legend:

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

    r2994 r3002  
    3333    private IObservableArray<T> array;
    3434
     35    #region Persistence
     36    private ReadOnlyObservableArray() { }
     37
     38    [StorableHook(HookType.AfterDeserialization)]
     39    private void PostDeserializationHook() {
     40      RegisterEvents();
     41    }
     42    #endregion
     43
    3544    #region Properties
    3645    public int Length {
     
    5362    #endregion
    5463
     64   
     65
    5566    #region Constructors
    5667    public ReadOnlyObservableArray(IObservableArray<T> array) {
    5768      if (array == null) throw new ArgumentNullException();
    5869      this.array = array;
     70      RegisterEvents();
     71    }
     72
     73    private void RegisterEvents() {
    5974      array.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<T>>(array_ItemsReplaced);
    6075      array.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<T>>(array_ItemsMoved);
  • trunk/sources/HeuristicLab.Collections/3.3/ReadOnlyObservableCollection.cs

    r2994 r3002  
    3333    private IObservableCollection<T> collection;
    3434
     35    #region persistence
     36    private ReadOnlyObservableCollection() { }
     37
     38    [StorableHook(HookType.AfterDeserialization)]
     39    private void PostDeserializationHook() {
     40      RegisterEvents();
     41    }
     42    #endregion
     43
    3544    #region Properties
    3645    public int Count {
     
    4655      if (collection == null) throw new ArgumentNullException();
    4756      this.collection = collection;
     57      RegisterEvents();
     58    }
     59
     60    private void RegisterEvents() {
    4861      collection.ItemsAdded += new CollectionItemsChangedEventHandler<T>(collection_ItemsAdded);
    4962      collection.ItemsRemoved += new CollectionItemsChangedEventHandler<T>(collection_ItemsRemoved);
  • trunk/sources/HeuristicLab.Collections/3.3/ReadOnlyObservableDictionary.cs

    r2994 r3002  
    3333    private IObservableDictionary<TKey, TValue> dict;
    3434
     35    #region persistence
     36    private ReadOnlyObservableDictionary() { }
     37
     38    [StorableHook(HookType.AfterDeserialization)]
     39    private void PostDeserizlationHook() {
     40      RegisterEvents();
     41    }
     42    #endregion
     43
    3544    #region Properties
    3645    public ICollection<TKey> Keys {
     
    6069      if (dictionary == null) throw new ArgumentNullException();
    6170      dict = dictionary;
     71      RegisterEvents();
     72    }
     73
     74    private void RegisterEvents() {
    6275      dict.ItemsAdded += new CollectionItemsChangedEventHandler<KeyValuePair<TKey, TValue>>(dict_ItemsAdded);
    6376      dict.ItemsRemoved += new CollectionItemsChangedEventHandler<KeyValuePair<TKey, TValue>>(dict_ItemsRemoved);
  • trunk/sources/HeuristicLab.Collections/3.3/ReadOnlyObservableKeyedCollection.cs

    r2994 r3002  
    3333    private IObservableKeyedCollection<TKey, TItem> collection;
    3434
     35    #region persistence
     36    private ReadOnlyObservableKeyedCollection() { }
     37
     38    [StorableHook(HookType.AfterDeserialization)]
     39    private void PostDeserizlationHook() {
     40      RegisterEvents();
     41    }
     42    #endregion
     43
    3544    #region Properties
    3645    public int Count {
     
    5261      if (collection == null) throw new ArgumentNullException();
    5362      this.collection = collection;
     63      RegisterEvents();
     64    }
     65
     66    private void RegisterEvents() {
    5467      collection.ItemsAdded += new CollectionItemsChangedEventHandler<TItem>(collection_ItemsAdded);
    5568      collection.ItemsRemoved += new CollectionItemsChangedEventHandler<TItem>(collection_ItemsRemoved);
  • trunk/sources/HeuristicLab.Collections/3.3/ReadOnlyObservableList.cs

    r2994 r3002  
    3333    private IObservableList<T> list;
    3434
     35    #region persistence
     36    private ReadOnlyObservableList() { }
     37
     38    [StorableHook(HookType.AfterDeserialization)]
     39    private void PostDeserizlationHook() {
     40      RegisterEvents();
     41    }
     42    #endregion
     43
    3544    #region Properties
    3645    public int Count {
     
    5463      if (list == null) throw new ArgumentNullException();
    5564      this.list = list;
     65      RegisterEvents();
     66    }
     67
     68    private void RegisterEvents() {
    5669      list.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<T>>(list_ItemsAdded);
    5770      ((IObservableCollection<T>)list).ItemsAdded += new CollectionItemsChangedEventHandler<T>(list_ItemsAdded);
  • trunk/sources/HeuristicLab.Collections/3.3/ReadOnlyObservableSet.cs

    r2994 r3002  
    3333    private IObservableSet<T> set;
    3434
     35    #region persistence
     36    private ReadOnlyObservableSet() { }
     37
     38    [StorableHook(HookType.AfterDeserialization)]
     39    private void PostDeserizlationHook() {
     40      RegisterEvents();
     41    }
     42    #endregion
     43
    3544    #region Properties
    3645    public int Count {
     
    4655      if (set == null) throw new ArgumentNullException();
    4756      this.set = set;
     57      RegisterEvents();
     58    }
     59
     60    private void RegisterEvents() {
    4861      set.ItemsAdded += new CollectionItemsChangedEventHandler<T>(set_ItemsAdded);
    4962      set.ItemsRemoved += new CollectionItemsChangedEventHandler<T>(set_ItemsRemoved);
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/DebugString/DebugString.cs

    r2994 r3002  
    1616    public string Data { get; set; }
    1717
     18    private DebugString() { }
     19
    1820    public DebugString(string s) {
    1921      Data = s;
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlString.cs

    r2994 r3002  
    1212    public string Data { get; private set; }
    1313
     14    private XmlString() { }
     15
    1416    public XmlString(string data) {
    1517      Data = data;
Note: See TracChangeset for help on using the changeset viewer.