Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/23/12 11:16:22 (13 years ago)
Author:
mkommend
Message:

#1782: Minor changes in discovery of problem instance providers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances/3.3/ProblemInstanceManager.cs

    r7867 r7875  
    3636          .Select(x => typeof(IProblemInstanceProvider<>).MakeGenericType(x));
    3737
    38         if (instanceTypes.Any(x => x.GetGenericArguments().First().IsInterface)) {
    39           var interfaceTypes = instanceTypes.Where(x => x.GetGenericArguments().First().IsInterface)
    40             .SelectMany(x => ApplicationManager.Manager.GetTypes(x.GetGenericArguments().First()));
     38        var interfaceTypes = instanceTypes.Where(x => x.GetGenericArguments().First().IsInterface);
     39        if (interfaceTypes.Any()) {
     40          var concreteTypes = interfaceTypes.SelectMany(x => ApplicationManager.Manager.GetTypes(x.GetGenericArguments().First()));
    4141
    42           if (interfaceTypes.Any())
    43             instanceTypes = instanceTypes.Union(interfaceTypes.Select(x => typeof(IProblemInstanceProvider<>).MakeGenericType(x))).Distinct();
     42          if (concreteTypes.Any())
     43            instanceTypes = instanceTypes.Union(concreteTypes.Select(x => typeof(IProblemInstanceProvider<>).MakeGenericType(x))).Distinct();
    4444        }
    4545
Note: See TracChangeset for help on using the changeset viewer.