Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/24/19 12:28:29 (5 years ago)
Author:
dpiringe
Message:

#2924:

  • merged projects HeuristicLab.PluginInfrastructure.Runner and HeuristicLab.PluginInfrastructure
  • applied changes of code reviews (13.05.2019 and 22.05.2019) -> the old Runner is now RunnerHost and uses a Runner, which is executed on the child process
  • added Type GetType(string) to IApplicationManager and implemented it for LightweightApplicationManager
  • removed IActivator and IActivatorContext
  • deleted unused types like PluginDescriptionIterator
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2924_DotNetCoreMigration/HeuristicLab.PluginInfrastructure/3.3/LightweightApplicationManager.cs

    r15973 r16984  
    7575      foreach (Type t in GetTypes(type)) {
    7676        object instance = null;
    77         try { instance = Activator.CreateInstance(t); }
    78         catch { }
     77        try { instance = Activator.CreateInstance(t); } catch { }
    7978        if (instance != null) instances.Add(instance);
    8079      }
    8180      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;
    8289    }
    8390
     
    126133        // necessary to make sure the exception is immediately thrown
    127134        // instead of later when the enumerable is iterated?
     135
    128136        var assemblyTypes = assembly.GetTypes();
    129137
     
    138146
    139147        return matchingTypes;
    140       }
    141       catch (TypeLoadException) {
     148      } catch (TypeLoadException) {
    142149        return Enumerable.Empty<Type>();
    143       }
    144       catch (ReflectionTypeLoadException) {
     150      } catch (ReflectionTypeLoadException) {
    145151        return Enumerable.Empty<Type>();
    146152      }
Note: See TracChangeset for help on using the changeset viewer.