Changeset 12031 for branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.PluginInfrastructure/3.3/LightweightApplicationManager.cs
- Timestamp:
- 02/18/15 10:54:32 (10 years ago)
- Location:
- branches/HeuristicLab.DatasetRefactor/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DatasetRefactor/sources
- Property svn:mergeinfo changed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.PluginInfrastructure/3.3/LightweightApplicationManager.cs
r11171 r12031 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 122 122 /// (interfaces, abstract classes... are not returned)</param> 123 123 /// <returns>Enumerable of the discovered types.</returns> 124 p rivate static IEnumerable<Type> GetTypes(Type type, Assembly assembly, bool onlyInstantiable = true, bool includeGenericTypeDefinitions = false) {124 public IEnumerable<Type> GetTypes(Type type, Assembly assembly, bool onlyInstantiable = true, bool includeGenericTypeDefinitions = false) { 125 125 try { 126 126 // necessary to make sure the exception is immediately thrown … … 148 148 149 149 /// <summary> 150 /// Discovers all types implementing or inheriting all or any type in <paramref name="types"/> (directly and indirectly) that are declared in the assembly <paramref name="assembly"/>. 151 /// </summary> 152 /// <param name="types">The types to discover.</param> 153 /// <param name="assembly">The declaring assembly.</param> 154 /// <param name="onlyInstantiable">Return only types that are instantiable (instance, abstract... are not returned)</param> 155 /// /// <param name="assignableToAllTypes">Specifies if discovered types must implement or inherit all given <paramref name="types"/>.</param> 156 /// <returns>An enumerable of discovered types.</returns> 157 public IEnumerable<Type> GetTypes(IEnumerable<Type> types, Assembly assembly, bool onlyInstantiable = true, bool includeGenericTypeDefinitions = false, bool assignableToAllTypes = true) { 158 IEnumerable<Type> result = GetTypes(types.First(), assembly, onlyInstantiable, includeGenericTypeDefinitions); 159 foreach (Type type in types.Skip(1)) { 160 IEnumerable<Type> discoveredTypes = GetTypes(type, assembly, onlyInstantiable, includeGenericTypeDefinitions); 161 if (assignableToAllTypes) result = result.Intersect(discoveredTypes); 162 else result = result.Union(discoveredTypes); 163 } 164 return result; 165 } 166 167 /// <summary> 150 168 /// Not supported by the LightweightApplicationManager 151 169 /// </summary>
Note: See TracChangeset
for help on using the changeset viewer.