Changeset 8215
- Timestamp:
- 07/04/12 17:09:59 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/Primitives/Group.cs
r4776 r8215 23 23 using System.Collections.Generic; 24 24 using System.Collections.ObjectModel; 25 using System.Text;26 25 using System.Drawing; 27 26 using System.Windows.Forms; … … 30 29 public class Group : PrimitiveBase, IGroup { 31 30 private IList<IPrimitive> myPrimitives; 31 private HashSet<IPrimitive> myPrimitivesLookup; 32 32 public virtual ReadOnlyCollection<IPrimitive> Primitives { 33 33 get { return new ReadOnlyCollection<IPrimitive>(myPrimitives); } … … 57 57 : base(chart) { 58 58 myPrimitives = new List<IPrimitive>(); 59 myPrimitivesLookup = new HashSet<IPrimitive>(); 59 60 } 60 61 … … 64 65 65 66 myPrimitives.Insert(0, primitive); 67 myPrimitivesLookup.Add(primitive); 66 68 primitive.Group = this; 67 69 primitive.Update += new EventHandler(primitive_Update); … … 74 76 75 77 myPrimitives.Insert(0, primitive); 78 myPrimitivesLookup.Add(primitive); 76 79 primitive.Group = this; 77 80 primitive.Update += new EventHandler(primitive_Update); … … 80 83 } 81 84 public virtual bool Contains(IPrimitive primitive) { 82 return myPrimitives .Contains(primitive);85 return myPrimitivesLookup.Contains(primitive); 83 86 } 84 87 public virtual bool Remove(IPrimitive primitive) { … … 98 101 } 99 102 myPrimitives.Clear(); 103 myPrimitivesLookup.Clear(); 100 104 OnUpdate(); 101 105 }
Note: See TracChangeset
for help on using the changeset viewer.