Changeset 2830 for trunk/sources/HeuristicLab.Core/3.3/ItemSet.cs
- Timestamp:
- 02/19/10 02:15:10 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/3.3/ItemSet.cs
r2790 r2830 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Collections; 24 25 using System.Collections.Generic; … … 55 56 56 57 public ItemSet() : base() { } 57 public ItemSet(IEnumerable<T> collection) : base(collection) { } 58 public ItemSet(IEnumerable<T> collection) : base(collection) { 59 foreach (T item in this) 60 item.Changed += new ChangedEventHandler(Item_Changed); 61 } 58 62 59 63 public object Clone() { … … 61 65 } 62 66 63 public IDeepCloneable Clone(Cloner cloner) { 64 List<T> items = new List<T>(); 65 foreach (T item in this) 66 items.Add((T)cloner.Clone(item)); 67 ItemSet<T> clone = (ItemSet<T>)Activator.CreateInstance(this.GetType(), items); 67 public virtual IDeepCloneable Clone(Cloner cloner) { 68 ItemSet<T> clone = (ItemSet<T>)Activator.CreateInstance(this.GetType(), this.Select(x => (T)cloner.Clone(x))); 68 69 cloner.RegisterClonedObject(this, clone); 69 70 return clone;
Note: See TracChangeset
for help on using the changeset viewer.