Changeset 10497
- Timestamp:
- 02/21/14 14:00:43 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelector.cs
r9456 r10497 112 112 typesTreeView.Nodes.Clear(); 113 113 treeNodes.Clear(); 114 114 115 imageList.Images.Clear(); 115 116 imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Class); // default icon … … 117 118 imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Interface); // interfaces 118 119 imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Template); // generic types 120 // additional dictionary for image indexes as imageList.ContainsKey and imageList.IndexOfKey are very slow! 121 var imageNames = new Dictionary<string, int>(); 119 122 120 123 var plugins = from p in ApplicationManager.Manager.Plugins … … 141 144 if (type.IsInterface) typeNode.ImageIndex = 2; 142 145 else if (type.ContainsGenericParameters) typeNode.ImageIndex = 3; 143 else if (image List.Images.ContainsKey(type.FullName)) typeNode.ImageIndex = imageList.Images.IndexOfKey(type.FullName);146 else if (imageNames.ContainsKey(type.FullName)) typeNode.ImageIndex = imageNames[type.FullName]; 144 147 else { 145 148 var image = ItemAttribute.GetImage(type); 146 149 if (image != null) { 147 imageList.Images.Add(type.FullName, image); 148 typeNode.ImageIndex = imageList.Images.IndexOfKey(type.FullName); 150 imageList.Images.Add(image); 151 typeNode.ImageIndex = imageList.Images.Count - 1; 152 imageNames.Add(type.FullName, imageList.Images.Count - 1); 149 153 } 150 154 }
Note: See TracChangeset
for help on using the changeset viewer.