Changeset 2992
- Timestamp:
- 03/10/10 16:30:27 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewContextMenuStrip.cs
r2837 r2992 41 41 if (this.item != null) { 42 42 ToolStripMenuItem menuItem; 43 IEnumerable<Type> types = MainFormManager.GetViewTypes(item.GetType() );43 IEnumerable<Type> types = MainFormManager.GetViewTypes(item.GetType(),true); 44 44 foreach (Type t in types) { 45 45 menuItem = new ToolStripMenuItem(); -
trunk/sources/HeuristicLab.MainForm/3.2/MainFormManager.cs
r2810 r2992 83 83 } 84 84 return viewTypes.Where(t => t != null); 85 } 86 87 public static IEnumerable<Type> GetViewTypes(Type contentType, bool returnOnlyMostSpecificViewTypes) { 88 List<Type> viewTypes = new List<Type>(GetViewTypes(contentType)); 89 if (returnOnlyMostSpecificViewTypes) { 90 foreach (Type viewType in viewTypes.ToList()) { 91 if(viewTypes.Any(t => t.IsSubclassOf(viewType))) 92 viewTypes.Remove(viewType); 93 } 94 } 95 return viewTypes; 85 96 } 86 97
Note: See TracChangeset
for help on using the changeset viewer.