Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/30/10 15:13:38 (14 years ago)
Author:
svonolfe
Message:

Added check to ProgrammableOperator if the ApplicationManager exists so it can be used outside of HL (#842)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Programmable/3.3/ProgrammableOperator.cs

    r3160 r3234  
    197197      var plugins = new Dictionary<string, List<Assembly>>();
    198198      var locationTable = assemblies.ToDictionary(a => a.Location, a => a);
    199       foreach (var plugin in ApplicationManager.Manager.Plugins) {
    200         var aList = new List<Assembly>();
    201         foreach (var aName in from file in plugin.Files
    202                               where file.Type == PluginFileType.Assembly
    203                               select file.Name) {
    204           Assembly a;
    205           locationTable.TryGetValue(aName, out a);
    206           if (a != null) {
    207             aList.Add(a);
    208             locationTable.Remove(aName);
     199
     200      if (ApplicationManager.Manager != null) {
     201        foreach (var plugin in ApplicationManager.Manager.Plugins) {
     202          var aList = new List<Assembly>();
     203          foreach (var aName in from file in plugin.Files
     204                                where file.Type == PluginFileType.Assembly
     205                                select file.Name) {
     206            Assembly a;
     207            locationTable.TryGetValue(aName, out a);
     208            if (a != null) {
     209              aList.Add(a);
     210              locationTable.Remove(aName);
     211            }
    209212          }
    210         }
    211         plugins[plugin.Name] = aList;
    212       }
     213          plugins[plugin.Name] = aList;
     214        }
     215      }
     216
    213217      plugins["other"] = locationTable.Values.ToList();
    214218      return plugins;
Note: See TracChangeset for help on using the changeset viewer.