Changeset 16984 for branches/2924_DotNetCoreMigration/HeuristicLab.PluginInfrastructure/3.3/LightweightApplicationManager.cs
- Timestamp:
- 05/24/19 12:28:29 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2924_DotNetCoreMigration/HeuristicLab.PluginInfrastructure/3.3/LightweightApplicationManager.cs
r15973 r16984 75 75 foreach (Type t in GetTypes(type)) { 76 76 object instance = null; 77 try { instance = Activator.CreateInstance(t); } 78 catch { } 77 try { instance = Activator.CreateInstance(t); } catch { } 79 78 if (instance != null) instances.Add(instance); 80 79 } 81 80 return instances; 81 } 82 83 public Type GetType(string typeName) { 84 foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies()) { 85 Type t = asm.GetType(typeName); 86 if (t != null) return t; 87 } 88 return null; 82 89 } 83 90 … … 126 133 // necessary to make sure the exception is immediately thrown 127 134 // instead of later when the enumerable is iterated? 135 128 136 var assemblyTypes = assembly.GetTypes(); 129 137 … … 138 146 139 147 return matchingTypes; 140 } 141 catch (TypeLoadException) { 148 } catch (TypeLoadException) { 142 149 return Enumerable.Empty<Type>(); 143 } 144 catch (ReflectionTypeLoadException) { 150 } catch (ReflectionTypeLoadException) { 145 151 return Enumerable.Empty<Type>(); 146 152 }
Note: See TracChangeset
for help on using the changeset viewer.