Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5903


Ignore:
Timestamp:
03/31/11 10:42:06 (13 years ago)
Author:
gkronber
Message:

#1454: renamed parameter and minor changes.

Location:
trunk/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelector.cs

    r5898 r5903  
    8989    }
    9090
    91     public virtual void Configure(IEnumerable<Type> baseTypes, bool showNotInstantiableTypes, bool showGenericTypes, bool allTypes) {
     91    public virtual void Configure(IEnumerable<Type> baseTypes, bool showNotInstantiableTypes, bool showGenericTypes, bool assignableToAllTypes) {
    9292      if (baseTypes == null) throw new ArgumentNullException();
    9393      if (InvokeRequired)
    94         Invoke(new Action<IEnumerable<Type>, bool, bool, bool>(Configure), baseTypes, showNotInstantiableTypes, showGenericTypes, allTypes);
     94        Invoke(new Action<IEnumerable<Type>, bool, bool, bool>(Configure), baseTypes, showNotInstantiableTypes, showGenericTypes, assignableToAllTypes);
    9595      else {
    9696        this.baseTypes = baseTypes;
     
    119119          pluginNode.Tag = plugin;
    120120
    121           var types = from t in ApplicationManager.Manager.GetTypes(BaseTypes, plugin, ShowNotInstantiableTypes, allTypes)
     121          var types = from t in ApplicationManager.Manager.GetTypes(BaseTypes, plugin, ShowNotInstantiableTypes, assignableToAllTypes)
    122122                      orderby t.Name ascending
    123123                      select t;
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/DefaultApplicationManager.cs

    r5850 r5903  
    225225    }
    226226
    227     internal static IEnumerable<Type> GetTypes(IEnumerable<Type> types, bool onlyInstantiable, bool allTypes) {
     227    internal static IEnumerable<Type> GetTypes(IEnumerable<Type> types, bool onlyInstantiable, bool assignableToAllTypes) {
    228228      IEnumerable<Type> result = GetTypes(types.First(), onlyInstantiable);
    229229      foreach (Type type in types.Skip(1)) {
    230230        IEnumerable<Type> discoveredTypes = GetTypes(type, onlyInstantiable);
    231         if (allTypes) result = result.Intersect(discoveredTypes);
     231        if (assignableToAllTypes) result = result.Intersect(discoveredTypes);
    232232        else result = result.Union(discoveredTypes);
    233233      }
    234 
    235       if (!allTypes) return result.Distinct();
    236234      return result;
    237235    }
     
    255253    }
    256254
    257     internal static IEnumerable<Type> GetTypes(IEnumerable<Type> types, IPluginDescription pluginDescription, bool onlyInstantiable, bool allTypes) {
     255    internal static IEnumerable<Type> GetTypes(IEnumerable<Type> types, IPluginDescription pluginDescription, bool onlyInstantiable, bool assignableToAllTypes) {
    258256      IEnumerable<Type> result = GetTypes(types.First(), pluginDescription, onlyInstantiable);
    259257      foreach (Type type in types.Skip(1)) {
    260258        IEnumerable<Type> discoveredTypes = GetTypes(type, pluginDescription, onlyInstantiable);
    261         if (allTypes) result = result.Intersect(discoveredTypes);
     259        if (assignableToAllTypes) result = result.Intersect(discoveredTypes);
    262260        else result = result.Union(discoveredTypes);
    263261      }
    264 
    265       if (!allTypes) return result.Distinct();
    266262      return result;
    267263    }
     
    341337      return GetTypes(type, onlyInstantiable);
    342338    }
    343     IEnumerable<Type> IApplicationManager.GetTypes(IEnumerable<Type> types, bool onlyInstantiable, bool allTypes) {
    344       return GetTypes(types, onlyInstantiable, allTypes);
     339    IEnumerable<Type> IApplicationManager.GetTypes(IEnumerable<Type> types, bool onlyInstantiable, bool assignableToAllTypes) {
     340      return GetTypes(types, onlyInstantiable, assignableToAllTypes);
    345341    }
    346342
     
    348344      return GetTypes(type, plugin, onlyInstantiable);
    349345    }
    350     IEnumerable<Type> IApplicationManager.GetTypes(IEnumerable<Type> types, IPluginDescription plugin, bool onlyInstantiable, bool allTypes) {
    351       return GetTypes(types, plugin, onlyInstantiable, allTypes);
     346    IEnumerable<Type> IApplicationManager.GetTypes(IEnumerable<Type> types, IPluginDescription plugin, bool onlyInstantiable, bool assignableToAllTypes) {
     347      return GetTypes(types, plugin, onlyInstantiable, assignableToAllTypes);
    352348    }
    353349
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Interfaces/IApplicationManager.cs

    r5850 r5903  
    6565    /// <param name="types">The types to discover.</param>
    6666    /// <param name="onlyInstantiable">Return only types that are instantiable (instance, abstract... are not returned)</param>
    67     /// <param name="allTypes">Specifies if discovered types must implement or inherit all given <paramref name="types"/>.</param>
     67    /// <param name="assignableToAllTypes">Specifies if discovered types must implement or inherit all given <paramref name="types"/>.</param>
    6868    /// <returns>An enumerable of discovered types.</returns>
    69     IEnumerable<Type> GetTypes(IEnumerable<Type> types, bool onlyInstantiable = true, bool allTypes = true);
     69    IEnumerable<Type> GetTypes(IEnumerable<Type> types, bool onlyInstantiable = true, bool assignableToAllTypes = true);
    7070
    7171    /// <summary>
     
    8484    /// <param name="plugin">The declaring plugin.</param>
    8585    /// <param name="onlyInstantiable">Return only types that are instantiable (instance, abstract... are not returned)</param>
    86     /// /// <param name="allTypes">Specifies if discovered types must implement or inherit all given <paramref name="types"/>.</param>
     86    /// /// <param name="assignableToAllTypes">Specifies if discovered types must implement or inherit all given <paramref name="types"/>.</param>
    8787    /// <returns>An enumerable of discovered types.</returns>
    88     IEnumerable<Type> GetTypes(IEnumerable<Type> types, IPluginDescription plugin, bool onlyInstantiable = true, bool allTypes = true);
     88    IEnumerable<Type> GetTypes(IEnumerable<Type> types, IPluginDescription plugin, bool onlyInstantiable = true, bool assignableToAllTypes = true);
    8989
    9090    /// <summary>
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/LightweightApplicationManager.cs

    r5850 r5903  
    8989    /// (interfaces, abstract classes... are not returned)</remarks>
    9090    /// <returns>Enumerable of the discovered types.</returns>
    91     public IEnumerable<Type> GetTypes(IEnumerable<Type> types, bool onlyInstantiable = true, bool allTypes = true) {
     91    public IEnumerable<Type> GetTypes(IEnumerable<Type> types, bool onlyInstantiable = true, bool assignableToAllTypes = true) {
    9292      IEnumerable<Type> result = GetTypes(types.First(), onlyInstantiable);
    9393      foreach (Type type in types.Skip(1)) {
    9494        IEnumerable<Type> discoveredTypes = GetTypes(type, onlyInstantiable);
    95         if (allTypes) result = result.Intersect(discoveredTypes);
     95        if (assignableToAllTypes) result = result.Intersect(discoveredTypes);
    9696        else result = result.Union(discoveredTypes);
    9797      }
    98 
    99       if (!allTypes) return result.Distinct();
    10098      return result;
    10199    }
     
    194192    /// <returns></returns>
    195193    /// <throws>NotSupportedException</throws>
    196     public IEnumerable<Type> GetTypes(IEnumerable<Type> types, IPluginDescription plugin, bool onlyInstantiable = true, bool allTypes = true) {
     194    public IEnumerable<Type> GetTypes(IEnumerable<Type> types, IPluginDescription plugin, bool onlyInstantiable = true, bool assignableToAllTypes = true) {
    197195      throw new NotSupportedException("LightweightApplicationManager doesn't support type discovery for plugins.");
    198196    }
Note: See TracChangeset for help on using the changeset viewer.