Changeset 7586
- Timestamp:
- 03/08/12 11:19:37 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/SandboxApplicationManager.cs
r7520 r7586 119 119 try { 120 120 runnablePlugin.Run(); 121 } finally { 121 } 122 finally { 122 123 // unload plugins in reverse order 123 124 foreach (var plugin in loadedPlugins.Reverse<IPlugin>()) { … … 149 150 foreach (Type t in GetTypes(typeof(T), plugin, onlyInstantiable: true, includeGenericTypeDefinitions: false)) { 150 151 T instance = null; 151 try { instance = (T)Activator.CreateInstance(t); } catch { } 152 try { instance = (T)Activator.CreateInstance(t); } 153 catch { } 152 154 if (instance != null) instances.Add(instance); 153 155 } … … 164 166 foreach (Type t in GetTypes(typeof(T), asm, onlyInstantiable: true, includeGenericTypeDefinitions: false)) { 165 167 T instance = null; 166 try { instance = (T)Activator.CreateInstance(t); } catch { } 168 try { instance = (T)Activator.CreateInstance(t); } 169 catch { } 167 170 if (instance != null) instances.Add(instance); 168 171 } … … 188 191 foreach (Type t in GetTypes(type, onlyInstantiable: true, includeGenericTypeDefinitions: false)) { 189 192 object instance = null; 190 try { instance = Activator.CreateInstance(t); } catch { } 193 try { instance = Activator.CreateInstance(t); } 194 catch { } 191 195 if (instance != null) instances.Add(instance); 192 196 } … … 231 235 PluginDescription pluginDesc = (PluginDescription)pluginDescription; 232 236 return from asm in AppDomain.CurrentDomain.GetAssemblies() 233 where !asm.IsDynamic 237 where !asm.IsDynamic && !string.IsNullOrEmpty(asm.Location) 234 238 where pluginDesc.AssemblyLocations.Any(location => location.Equals(Path.GetFullPath(asm.Location), StringComparison.CurrentCultureIgnoreCase)) 235 239 from t in GetTypes(type, asm, onlyInstantiable, includeGenericTypeDefinitions) … … 299 303 if (type.IsAssignableFrom(otherGenericTypeDefinition.MakeGenericType(typeGenericArguments))) 300 304 return true; 301 } catch (Exception) { } 305 } 306 catch (Exception) { } 302 307 } 303 308 return false;
Note: See TracChangeset
for help on using the changeset viewer.