Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3560


Ignore:
Timestamp:
04/30/10 02:48:19 (14 years ago)
Author:
swagner
Message:

Fixed persistence exceptions by restoring the reference on HeuristicLab.Persistence in HeuristicLab.Collections (#977)

Location:
trunk/sources
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Collections/3.3/HeuristicLab.Collections-3.3.csproj

    r3390 r3560  
    122122  </ItemGroup>
    123123  <ItemGroup>
     124    <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
     125      <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
     126      <Name>HeuristicLab.Persistence-3.3</Name>
     127    </ProjectReference>
    124128    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
    125129      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
  • trunk/sources/HeuristicLab.Collections/3.3/HeuristicLabCollectionsPlugin.cs.frame

    r3384 r3560  
    2828  [Plugin("HeuristicLab.Collections", "3.3.0.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Collections-3.3.dll", PluginFileType.Assembly)]
    30   [PluginDependency("HeuristicLab.Common", "3.3")]
    3130  [PluginDependency("HeuristicLab.Persistence", "3.3")]
    3231  public class HeuristicLabCollectionsPlugin : PluginBase {
  • trunk/sources/HeuristicLab.Collections/3.3/ObservableArray.cs

    r3390 r3560  
    2525using System.ComponentModel;
    2626using System.Linq;
     27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2728
    2829namespace HeuristicLab.Collections {
     30  [StorableClass]
    2931  [Serializable]
    3032  public class ObservableArray<T> : IObservableArray<T> {
     33    [Storable]
    3134    protected T[] array;
    3235
     
    7073      array = collection.ToArray();
    7174    }
     75    [StorableConstructor]
     76    protected ObservableArray(bool deserializing) { }
    7277    #endregion
    7378
  • trunk/sources/HeuristicLab.Collections/3.3/ObservableCollection.cs

    r3390 r3560  
    2424using System.Collections.Generic;
    2525using System.ComponentModel;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
    2728namespace HeuristicLab.Collections {
     29  [StorableClass]
    2830  [Serializable]
    2931  public class ObservableCollection<T> : IObservableCollection<T> {
     32    [Storable]
    3033    protected List<T> list;
    3134
     
    5861      list = new List<T>(collection);
    5962    }
     63    [StorableConstructor]
     64    protected ObservableCollection(bool deserializing) { }
    6065    #endregion
    6166
  • trunk/sources/HeuristicLab.Collections/3.3/ObservableDictionary.cs

    r3390 r3560  
    2525using System.ComponentModel;
    2626using System.Linq;
     27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2728
    2829namespace HeuristicLab.Collections {
     30  [StorableClass]
    2931  [Serializable]
    3032  public class ObservableDictionary<TKey, TValue> : IObservableDictionary<TKey, TValue> {
     33    [Storable]
    3134    protected Dictionary<TKey, TValue> dict;
    3235
     
    8487      dict = new Dictionary<TKey, TValue>(dictionary, comparer);
    8588    }
     89    [StorableConstructor]
     90    protected ObservableDictionary(bool deserializing) { }
    8691    #endregion
    8792
  • trunk/sources/HeuristicLab.Collections/3.3/ObservableKeyedCollection.cs

    r3390 r3560  
    2525using System.ComponentModel;
    2626using System.Linq;
     27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2728
    2829namespace HeuristicLab.Collections {
     30  [StorableClass]
    2931  [Serializable]
    3032  public abstract class ObservableKeyedCollection<TKey, TItem> : IObservableKeyedCollection<TKey, TItem> {
     33    [Storable]
    3134    protected Dictionary<TKey, TItem> dict;
    3235
     
    7477        dict.Add(GetKeyForItem(item), item);
    7578    }
     79    [StorableConstructor]
     80    protected ObservableKeyedCollection(bool deserializing) { }
    7681    #endregion
    7782
  • trunk/sources/HeuristicLab.Collections/3.3/ObservableList.cs

    r3390 r3560  
    2424using System.Collections.Generic;
    2525using System.ComponentModel;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
    2728namespace HeuristicLab.Collections {
     29  [StorableClass]
    2830  [Serializable]
    2931  public class ObservableList<T> : IObservableList<T> {
     32    [Storable]
    3033    protected List<T> list;
    3134
     
    7275      list = new List<T>(collection);
    7376    }
     77    [StorableConstructor]
     78    protected ObservableList(bool deserializing) { }
    7479    #endregion
    7580
  • trunk/sources/HeuristicLab.Collections/3.3/ObservableSet.cs

    r3390 r3560  
    2525using System.ComponentModel;
    2626using System.Linq;
     27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2728
    2829namespace HeuristicLab.Collections {
     30  [StorableClass]
    2931  [Serializable]
    3032  public class ObservableSet<T> : IObservableSet<T> {
     33    [Storable]
    3134    protected HashSet<T> set;
    3235
     
    5659      set = new HashSet<T>(collection, comparer);
    5760    }
     61    [StorableConstructor]
     62    protected ObservableSet(bool deserializing) { }
    5863    #endregion
    5964
  • trunk/sources/HeuristicLab.Collections/3.3/ReadOnlyObservableArray.cs

    r3390 r3560  
    2424using System.Collections.Generic;
    2525using System.ComponentModel;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
    2728namespace HeuristicLab.Collections {
     29  [StorableClass]
    2830  [Serializable]
    2931  public class ReadOnlyObservableArray<T> : IObservableArray<T> {
     32    [Storable]
    3033    protected IObservableArray<T> array;
    3134
     
    5760      RegisterEvents();
    5861    }
     62    [StorableConstructor]
     63    protected ReadOnlyObservableArray(bool deserializing) { }
    5964    #endregion
    6065
     
    106111
    107112    #region Events
     113    [StorableHook(HookType.AfterDeserialization)]
    108114    protected void RegisterEvents() {
    109115      array.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<T>>(array_ItemsReplaced);
  • trunk/sources/HeuristicLab.Collections/3.3/ReadOnlyObservableCollection.cs

    r3390 r3560  
    2424using System.Collections.Generic;
    2525using System.ComponentModel;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
    2728namespace HeuristicLab.Collections {
     29  [StorableClass]
    2830  [Serializable]
    2931  public class ReadOnlyObservableCollection<T> : IObservableCollection<T> {
     32    [Storable]
    3033    protected IObservableCollection<T> collection;
    3134
     
    4649      RegisterEvents();
    4750    }
     51    [StorableConstructor]
     52    protected ReadOnlyObservableCollection(bool deserializing) { }
    4853    #endregion
    4954
     
    8489
    8590    #region Events
     91    [StorableHook(HookType.AfterDeserialization)]
    8692    protected void RegisterEvents() {
    8793      collection.ItemsAdded += new CollectionItemsChangedEventHandler<T>(collection_ItemsAdded);
  • trunk/sources/HeuristicLab.Collections/3.3/ReadOnlyObservableDictionary.cs

    r3390 r3560  
    2424using System.Collections.Generic;
    2525using System.ComponentModel;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
    2728namespace HeuristicLab.Collections {
     29  [StorableClass]
    2830  [Serializable]
    2931  public class ReadOnlyObservableDictionary<TKey, TValue> : IObservableDictionary<TKey, TValue> {
     32    [Storable]
    3033    protected IObservableDictionary<TKey, TValue> dict;
    3134
     
    6063      RegisterEvents();
    6164    }
     65    [StorableConstructor]
     66    protected ReadOnlyObservableDictionary(bool deserializing) { }
    6267    #endregion
    6368
     
    111116
    112117    #region Events
     118    [StorableHook(HookType.AfterDeserialization)]
    113119    protected void RegisterEvents() {
    114120      dict.ItemsAdded += new CollectionItemsChangedEventHandler<KeyValuePair<TKey, TValue>>(dict_ItemsAdded);
  • trunk/sources/HeuristicLab.Collections/3.3/ReadOnlyObservableKeyedCollection.cs

    r3390 r3560  
    2424using System.Collections.Generic;
    2525using System.ComponentModel;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
    2728namespace HeuristicLab.Collections {
     29  [StorableClass]
    2830  [Serializable]
    2931  public class ReadOnlyObservableKeyedCollection<TKey, TItem> : IObservableKeyedCollection<TKey, TItem> {
     32    [Storable]
    3033    protected IObservableKeyedCollection<TKey, TItem> collection;
    3134
     
    5255      RegisterEvents();
    5356    }
     57    [StorableConstructor]
     58    protected ReadOnlyObservableKeyedCollection(bool deserializing) { }
    5459    #endregion
    5560
     
    100105
    101106    #region Events
     107    [StorableHook(HookType.AfterDeserialization)]
    102108    protected void RegisterEvents() {
    103109      collection.ItemsAdded += new CollectionItemsChangedEventHandler<TItem>(collection_ItemsAdded);
  • trunk/sources/HeuristicLab.Collections/3.3/ReadOnlyObservableList.cs

    r3390 r3560  
    2424using System.Collections.Generic;
    2525using System.ComponentModel;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
    2728namespace HeuristicLab.Collections {
     29  [StorableClass]
    2830  [Serializable]
    2931  public class ReadOnlyObservableList<T> : IObservableList<T> {
     32    [Storable]
    3033    protected IObservableList<T> list;
    3134
     
    5457      RegisterEvents();
    5558    }
     59    [StorableConstructor]
     60    protected ReadOnlyObservableList(bool deserializing) { }
    5661    #endregion
    5762
     
    103108
    104109    #region Events
     110    [StorableHook(HookType.AfterDeserialization)]
    105111    protected void RegisterEvents() {
    106112      list.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<T>>(list_ItemsAdded);
  • trunk/sources/HeuristicLab.Collections/3.3/ReadOnlyObservableSet.cs

    r3390 r3560  
    2424using System.Collections.Generic;
    2525using System.ComponentModel;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
    2728namespace HeuristicLab.Collections {
     29  [StorableClass]
    2830  [Serializable]
    2931  public class ReadOnlyObservableSet<T> : IObservableSet<T> {
     32    [Storable]
    3033    protected IObservableSet<T> set;
    3134
     
    4649      RegisterEvents();
    4750    }
     51    [StorableConstructor]
     52    protected ReadOnlyObservableSet(bool deserializing) { }
    4853    #endregion
    4954
     
    125130
    126131    #region Events
     132    [StorableHook(HookType.AfterDeserialization)]
    127133    protected void RegisterEvents() {
    128134      set.ItemsAdded += new CollectionItemsChangedEventHandler<T>(set_ItemsAdded);
  • trunk/sources/HeuristicLab.Core/3.3/Collections/CheckedItemCollection.cs

    r3558 r3560  
    5858    }
    5959    [StorableConstructor]
    60     protected CheckedItemCollection(bool deserializing) { }
     60    protected CheckedItemCollection(bool deserializing) : base(deserializing) { }
    6161
    6262    public bool IsItemChecked(T item) {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ItemArray.cs

    r3550 r3560  
    5858    }
    5959
    60     [Storable]
    61     private T[] Items {
    62       get { return array; }
    63       set { array = value; }
    64     }
    65 
    6660    public ItemArray() : base() { }
    6761    public ItemArray(int length) : base(length) { }
     
    6963    public ItemArray(IEnumerable<T> collection) : base(collection) { }
    7064    [StorableConstructor]
    71     protected ItemArray(bool deserializing) { }
     65    protected ItemArray(bool deserializing) : base(deserializing) { }
    7266
    7367    public object Clone() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ItemCollection.cs

    r3550 r3560  
    5555    }
    5656
    57     [Storable]
    58     private List<T> Items {
    59       get { return list; }
    60       set { list = value; }
    61     }
    62 
    6357    public ItemCollection() : base() { }
    6458    public ItemCollection(int capacity) : base(capacity) { }
    6559    public ItemCollection(IEnumerable<T> collection) : base(collection) { }
    6660    [StorableConstructor]
    67     protected ItemCollection(bool deserializing) { }
     61    protected ItemCollection(bool deserializing) : base(deserializing) { }
    6862
    6963    public object Clone() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ItemDictionary.cs

    r3550 r3560  
    5555    }
    5656
    57     [Storable]
    58     private Dictionary<TKey, TValue> Items {
    59       get { return dict; }
    60       set { dict = value; }
    61     }
    62 
    6357    public ItemDictionary() : base() { }
    6458    public ItemDictionary(int capacity) : base(capacity) { }
    6559    public ItemDictionary(IDictionary<TKey, TValue> dictionary) : base(dictionary) { }
    6660    [StorableConstructor]
    67     protected ItemDictionary(bool deserializing) { }
     61    protected ItemDictionary(bool deserializing) : base(deserializing) { }
    6862
    6963    public object Clone() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ItemList.cs

    r3550 r3560  
    5858    }
    5959
    60     [Storable]
    61     private List<T> Items {
    62       get { return list; }
    63       set { list = value; }
    64     }
    65 
    6660    public ItemList() : base() { }
    6761    public ItemList(int capacity) : base(capacity) { }
    6862    public ItemList(IEnumerable<T> collection) : base(collection) { }
    6963    [StorableConstructor]
    70     protected ItemList(bool deserializing) { }
     64    protected ItemList(bool deserializing) : base(deserializing) { }
    7165
    7266    public object Clone() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ItemSet.cs

    r3550 r3560  
    5858    }
    5959
    60     [Storable]
    61     private HashSet<T> Items {
    62       get { return set; }
    63       set { set = value; }
    64     }
    65 
    6660    public ItemSet() : base() { }
    6761    public ItemSet(IEnumerable<T> collection) : base(collection) { }
    6862    [StorableConstructor]
    69     protected ItemSet(bool deserializing) { }
     63    protected ItemSet(bool deserializing) : base(deserializing) { }
    7064
    7165    public object Clone() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/KeyedItemCollection.cs

    r3550 r3560  
    5454    }
    5555
    56     [Storable]
    57     private Dictionary<TKey, TItem> Items {
    58       get { return dict; }
    59       set { dict = value; }
    60     }
    61 
    6256    protected KeyedItemCollection() : base() { }
    6357    protected KeyedItemCollection(int capacity) : base(capacity) { }
    6458    protected KeyedItemCollection(IEnumerable<TItem> collection) : base(collection) { }
    6559    [StorableConstructor]
    66     protected KeyedItemCollection(bool deserializing) { }
     60    protected KeyedItemCollection(bool deserializing) : base(deserializing) { }
    6761
    6862    public object Clone() {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/NamedItemCollection.cs

    r3390 r3560  
    3838    }
    3939    [StorableConstructor]
    40     protected NamedItemCollection(bool deserializing) { }
     40    protected NamedItemCollection(bool deserializing) : base(deserializing) { }
    4141
    4242    [StorableHook(HookType.AfterDeserialization)]
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ReadOnlyItemArray.cs

    r3550 r3560  
    5555    }
    5656
    57     [Storable]
    58     private IObservableArray<T> Items {
    59       get { return array; }
    60       set { array = value; }
    61     }
    62 
    6357    public ReadOnlyItemArray() : base(new ItemArray<T>()) { }
    6458    public ReadOnlyItemArray(IItemArray<T> array) : base(array) { }
    6559    [StorableConstructor]
    66     protected ReadOnlyItemArray(bool deserializing) { }
    67 
    68     [StorableHook(HookType.AfterDeserialization)]
    69     private void Initialize() {
    70       RegisterEvents();
    71     }
     60    protected ReadOnlyItemArray(bool deserializing) : base(deserializing) { }
    7261
    7362    public object Clone() {
     
    7867      cloner.RegisterClonedObject(this, clone);
    7968      clone.array = (IItemArray<T>)((IItemArray<T>)array).Clone(cloner);
    80       clone.Initialize();
     69      clone.RegisterEvents();
    8170      return clone;
    8271    }
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ReadOnlyItemCollection.cs

    r3550 r3560  
    5555    }
    5656
    57     [Storable]
    58     private IObservableCollection<T> Items {
    59       get { return collection; }
    60       set { collection = value; }
    61     }
    62 
    6357    public ReadOnlyItemCollection() : base(new ItemCollection<T>()) { }
    6458    public ReadOnlyItemCollection(IItemCollection<T> collection) : base(collection) { }
    6559    [StorableConstructor]
    66     protected ReadOnlyItemCollection(bool deserializing) { }
    67 
    68     [StorableHook(HookType.AfterDeserialization)]
    69     private void Initialize() {
    70       RegisterEvents();
    71     }
     60    protected ReadOnlyItemCollection(bool deserializing) : base(deserializing) { }
    7261
    7362    public object Clone() {
     
    7867      cloner.RegisterClonedObject(this, clone);
    7968      clone.collection = (IItemCollection<T>)((IItemCollection<T>)collection).Clone(cloner);
    80       clone.Initialize();
     69      clone.RegisterEvents();
    8170      return clone;
    8271    }
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ReadOnlyItemDictionary.cs

    r3550 r3560  
    5555    }
    5656
    57     [Storable]
    58     private IObservableDictionary<TKey, TValue> Items {
    59       get { return dict; }
    60       set { dict = value; }
    61     }
    62 
    6357    public ReadOnlyItemDictionary() : base(new ItemDictionary<TKey, TValue>()) { }
    6458    public ReadOnlyItemDictionary(IItemDictionary<TKey, TValue> dictionary) : base(dictionary) { }
    6559    [StorableConstructor]
    66     protected ReadOnlyItemDictionary(bool deserializing) { }
    67 
    68     [StorableHook(HookType.AfterDeserialization)]
    69     private void Initialize() {
    70       RegisterEvents();
    71     }
     60    protected ReadOnlyItemDictionary(bool deserializing) : base(deserializing) { }
    7261
    7362    public object Clone() {
     
    7867      cloner.RegisterClonedObject(this, clone);
    7968      clone.dict = (IItemDictionary<TKey, TValue>)((IItemDictionary<TKey, TValue>)dict).Clone(cloner);
    80       clone.Initialize();
     69      clone.RegisterEvents();
    8170      return clone;
    8271    }
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ReadOnlyItemList.cs

    r3550 r3560  
    5555    }
    5656
    57     [Storable]
    58     private IObservableList<T> Items {
    59       get { return list; }
    60       set { list = value; }
    61     }
    62 
    6357    public ReadOnlyItemList() : base(new ItemList<T>()) { }
    6458    public ReadOnlyItemList(IItemList<T> list) : base(list) { }
    6559    [StorableConstructor]
    66     protected ReadOnlyItemList(bool deserializing) { }
    67 
    68     [StorableHook(HookType.AfterDeserialization)]
    69     private void Initialize() {
    70       RegisterEvents();
    71     }
     60    protected ReadOnlyItemList(bool deserializing) : base(deserializing) { }
    7261
    7362    public object Clone() {
     
    7867      cloner.RegisterClonedObject(this, clone);
    7968      clone.list = (IItemList<T>)((IItemList<T>)list).Clone(cloner);
    80       clone.Initialize();
     69      clone.RegisterEvents();
    8170      return clone;
    8271    }
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ReadOnlyItemSet.cs

    r3550 r3560  
    5555    }
    5656
    57     [Storable]
    58     private IObservableSet<T> Items {
    59       get { return set; }
    60       set { set = value; }
    61     }
    62 
    6357    public ReadOnlyItemSet() : base(new ItemSet<T>()) { }
    6458    public ReadOnlyItemSet(IItemSet<T> set) : base(set) { }
    6559    [StorableConstructor]
    66     protected ReadOnlyItemSet(bool deserializing) { }
    67 
    68     [StorableHook(HookType.AfterDeserialization)]
    69     private void Initialize() {
    70       RegisterEvents();
    71     }
     60    protected ReadOnlyItemSet(bool deserializing) : base(deserializing) { }
    7261
    7362    public object Clone() {
     
    7867      cloner.RegisterClonedObject(this, clone);
    7968      clone.set = (IItemSet<T>)((IItemSet<T>)set).Clone(cloner);
    80       clone.Initialize();
     69      clone.RegisterEvents();
    8170      return clone;
    8271    }
  • trunk/sources/HeuristicLab.Core/3.3/Collections/ReadOnlyKeyedItemCollection.cs

    r3550 r3560  
    5555    }
    5656
    57     [Storable]
    58     private IObservableKeyedCollection<TKey, TItem> Items {
    59       get { return collection; }
    60       set { collection = value; }
    61     }
    62 
    6357    protected ReadOnlyKeyedItemCollection() : base() { }
    6458    public ReadOnlyKeyedItemCollection(IKeyedItemCollection<TKey, TItem> collection) : base(collection) { }
    6559    [StorableConstructor]
    66     protected ReadOnlyKeyedItemCollection(bool deserializing) { }
    67 
    68     [StorableHook(HookType.AfterDeserialization)]
    69     private void Initialize() {
    70       RegisterEvents();
    71     }
     60    protected ReadOnlyKeyedItemCollection(bool deserializing) : base(deserializing) { }
    7261
    7362    public object Clone() {
     
    7867      cloner.RegisterClonedObject(this, clone);
    7968      clone.collection = (IKeyedItemCollection<TKey, TItem>)((IKeyedItemCollection<TKey, TItem>)collection).Clone(cloner);
    80       clone.Initialize();
     69      clone.RegisterEvents();
    8170      return clone;
    8271    }
Note: See TracChangeset for help on using the changeset viewer.