Changeset 2444 for branches/Mainform refactoring/HeuristicLab.MainForm/3.2
- Timestamp:
- 10/20/09 16:22:27 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Mainform refactoring/HeuristicLab.MainForm/3.2/MainFormManager.cs
r2443 r2444 44 44 45 45 DiscoveryService ds = new DiscoveryService(); 46 Type[] types = ds.GetTypes(typeof(IView)); 46 IEnumerable<Type> types = 47 from t in ds.GetTypes(typeof(IView)) 48 where !t.IsAbstract && !t.IsInterface && !t.IsGenericType 49 select t; 47 50 48 foreach (Type t in types .Where(t => !t.IsAbstract && !t.IsInterface && !t.IsGenericType)) {51 foreach (Type t in types) { 49 52 foreach (Type viewableType in GetViewableType(t)) { 50 53 if (viewableType != null) { … … 69 72 70 73 private static IEnumerable<Type> GetViewableType(Type t) { 71 foreach (Type interfaceType in t.GetInterfaces().Where(i => i.Namespace == "HeuristicLab.MainForm" && i.Name.StartsWith("IView"))) { 72 if (interfaceType.IsGenericType && !interfaceType.IsGenericTypeDefinition) 74 IEnumerable<Type> interfaceTypes = 75 from type in t.GetInterfaces() 76 where type.Namespace == "HeuristicLab.MainForm" && type.Name.StartsWith("IView") && 77 type.IsGenericType && !type.IsGenericTypeDefinition 78 select type; 79 80 foreach (Type interfaceType in interfaceTypes) { 73 81 yield return interfaceType.GetGenericArguments()[0]; 74 82 } … … 100 108 return defaultViews[viewableType]; 101 109 else { 102 List<Type> temp = defaultViews.Keys.Where(x => x.IsAssignableFrom(viewableType)).ToList(); 110 List<Type> temp = (from t in defaultViews.Keys 111 where t.IsAssignableFrom(viewableType) 112 select t).ToList(); 103 113 //no assignable type found 104 114 if (temp.Count == 0)
Note: See TracChangeset
for help on using the changeset viewer.