Changeset 5631 for trunk/sources
- Timestamp:
- 03/08/11 11:55:09 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Manager/PluginValidator.cs
r5629 r5631 141 141 142 142 plugins = pluginDescriptions; 143 DiscoverApplications( );144 } 145 146 private void DiscoverApplications( ) {143 DiscoverApplications(pluginDescriptions); 144 } 145 146 private void DiscoverApplications(IEnumerable<PluginDescription> pluginDescriptions) { 147 147 applications = new List<ApplicationDescription>(); 148 149 foreach (IApplication application in GetApplications()) { 148 foreach (IApplication application in GetApplications(pluginDescriptions)) { 150 149 Type appType = application.GetType(); 151 150 ApplicationAttribute attr = (from x in appType.GetCustomAttributes(typeof(ApplicationAttribute), false) 152 151 select (ApplicationAttribute)x).Single(); 153 var declaringPlugin = GetDeclaringPlugin(appType, plugins);154 152 ApplicationDescription info = new ApplicationDescription(); 153 PluginDescription declaringPlugin = GetDeclaringPlugin(appType, pluginDescriptions); 155 154 info.Name = application.Name; 156 155 info.Version = declaringPlugin.Version; … … 164 163 } 165 164 166 private static IEnumerable<IApplication> GetApplications( ) {165 private static IEnumerable<IApplication> GetApplications(IEnumerable<PluginDescription> pluginDescriptions) { 167 166 return from asm in AppDomain.CurrentDomain.GetAssemblies() 168 167 from t in asm.GetTypes() 169 168 where typeof(IApplication).IsAssignableFrom(t) && 170 169 !t.IsAbstract && !t.IsInterface && !t.HasElementType 170 where GetDeclaringPlugin(t, pluginDescriptions).PluginState != PluginState.Disabled 171 171 select (IApplication)Activator.CreateInstance(t); 172 172 } … … 597 597 } 598 598 599 private PluginDescription GetDeclaringPlugin(Type appType, IEnumerable<PluginDescription> plugins) {599 private static PluginDescription GetDeclaringPlugin(Type appType, IEnumerable<PluginDescription> plugins) { 600 600 return (from p in plugins 601 601 from asmLocation in p.AssemblyLocations
Note: See TracChangeset
for help on using the changeset viewer.