Changeset 7069


Ignore:
Timestamp:
11/24/11 17:04:12 (8 years ago)
Author:
mkommend
Message:

#1689: Corrected type discovery and adapted MainFormManager to work correctly.

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm/3.3/MainFormManager.cs

    r5445 r7069  
    4949        MainFormManager.mainform = mainForm;
    5050        IEnumerable<Type> types =
    51           from t in ApplicationManager.Manager.GetTypes(typeof(IContentView))
     51          from t in ApplicationManager.Manager.GetTypes(typeof(IContentView), false)
    5252          where !t.IsAbstract && !t.IsInterface && ContentAttribute.HasContentAttribute(t)
    5353          select t;
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/LightweightApplicationManager.cs

    r7066 r7069  
    124124        var assemblyTypes = assembly.GetTypes();
    125125
    126         return from t in assemblyTypes
    127                where !IsNonDiscoverableType(t)
    128                where CheckTypeCompatibility(type, t)
    129                where onlyInstantiable == false || (!t.IsAbstract && !t.IsInterface && !t.HasElementType && !t.IsGenericTypeDefinition)
    130                select BuildType(t, type);
     126        var buildTypes = from t in assemblyTypes
     127                         where !IsNonDiscoverableType(t)
     128                         where CheckTypeCompatibility(type, t)
     129                         where onlyInstantiable == false || (!t.IsAbstract && !t.IsInterface && !t.HasElementType)
     130                         select BuildType(t, type);
     131
     132        return from t in buildTypes
     133               where onlyInstantiable == false || !t.IsGenericTypeDefinition
     134               select t;
    131135      }
    132136      catch (TypeLoadException) {
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/SandboxApplicationManager.cs

    r7066 r7069  
    262262    /// <returns>Enumerable of the discovered types.</returns>
    263263    private static IEnumerable<Type> GetTypes(Type type, Assembly assembly, bool onlyInstantiable) {
    264       return from t in assembly.GetTypes()
    265              where !IsNonDiscoverableType(t)
    266              where CheckTypeCompatibility(type, t)
    267              where onlyInstantiable == false ||
    268                 (!t.IsAbstract && !t.IsInterface && !t.HasElementType && !t.IsGenericTypeDefinition)
    269              select BuildType(t, type);
     264      var buildTypes = from t in assembly.GetTypes()
     265                       where !IsNonDiscoverableType(t)
     266                       where CheckTypeCompatibility(type, t)
     267                       where onlyInstantiable == false ||
     268                             (!t.IsAbstract && !t.IsInterface && !t.HasElementType)
     269                       select BuildType(t, type);
     270
     271      return from t in buildTypes
     272             where onlyInstantiable == false || !t.IsGenericTypeDefinition
     273             select t;
    270274    }
    271275
Note: See TracChangeset for help on using the changeset viewer.