- Timestamp:
- 02/13/10 04:37:49 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/3.3/NamedItemCollection.cs
r2676 r2790 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-20 08Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using System.Collections;24 23 using System.Collections.Generic; 25 using System.Collections.ObjectModel; 26 using System.Text; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using System.Drawing; 28 25 using HeuristicLab.Collections; 29 26 using HeuristicLab.Common; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 28 31 29 namespace HeuristicLab.Core { 32 public class NamedItemCollection<T> : ObservableKeyedCollection<string, T>, IDeepCloneable where T : class, INamedItem { 30 [Item("NamedItemCollection<T>", "Represents a collection of named items.")] 31 public class NamedItemCollection<T> : ObservableKeyedCollection<string, T>, IItem where T : class, INamedItem { 32 public virtual string ItemName { 33 get { return ItemAttribute.GetName(this.GetType()); } 34 } 35 public virtual string ItemDescription { 36 get { return ItemAttribute.GetDescription(this.GetType()); } 37 } 38 public virtual Image ItemImage { 39 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Class; } 40 } 41 33 42 [Storable(Name = "RestoreEvents")] 34 43 private object RestoreEvents { … … 50 59 return Clone(new Cloner()); 51 60 } 52 53 61 public IDeepCloneable Clone(Cloner cloner) { 54 62 List<T> items = new List<T>(); … … 58 66 cloner.RegisterClonedObject(this, clone); 59 67 return clone; 68 } 69 70 public override string ToString() { 71 return ItemName; 60 72 } 61 73
Note: See TracChangeset
for help on using the changeset viewer.