@@ -251,27 +251,25 @@ public static string GetImplementationKey(Type type)
251
251
/// </summary>
252
252
/// <param name="baseType">The base type, which can optionally be abstract / interface.</param>
253
253
/// <returns>All implementations of the type in the current AppDomain.</returns>
254
- public static HashSet < Type > GetImplementationsOf ( Type baseType , bool allowAbstract , bool allowGeneric , bool allowRecursive = true )
254
+ public static HashSet < Type > GetImplementationsOf ( Type baseType , bool allowAbstract , bool allowGeneric , bool allowEnum , bool allowRecursive = true )
255
255
{
256
256
var key = GetImplementationKey ( baseType ) ;
257
257
258
258
int count = AllTypes . Count ;
259
259
HashSet < Type > ret ;
260
260
if ( ! baseType . IsGenericParameter )
261
- ret = GetImplementations ( key , baseType , allowAbstract , allowGeneric ) ;
261
+ ret = GetImplementations ( key , baseType , allowAbstract , allowGeneric , allowEnum ) ;
262
262
else
263
263
ret = GetGenericParameterImplementations ( key , baseType , allowAbstract , allowGeneric ) ;
264
264
265
265
// types were resolved during the parse, do it again if we're not already rebuilding.
266
266
if ( allowRecursive && AllTypes . Count != count )
267
- {
268
267
ret = GetImplementationsOf ( baseType , allowAbstract , allowGeneric , false ) ;
269
- }
270
268
271
269
return ret ;
272
270
}
273
271
274
- private static HashSet < Type > GetImplementations ( string key , Type baseType , bool allowAbstract , bool allowGeneric )
272
+ private static HashSet < Type > GetImplementations ( string key , Type baseType , bool allowAbstract , bool allowGeneric , bool allowEnum )
275
273
{
276
274
if ( ! typeInheritance . ContainsKey ( key ) )
277
275
{
@@ -287,7 +285,8 @@ private static HashSet<Type> GetImplementations(string key, Type baseType, bool
287
285
if ( set . Contains ( type )
288
286
|| ( type . IsAbstract && type . IsSealed ) // ignore static classes
289
287
|| ( ! allowAbstract && type . IsAbstract )
290
- || ( ! allowGeneric && ( type . IsGenericType || type . IsGenericTypeDefinition ) ) )
288
+ || ( ! allowGeneric && ( type . IsGenericType || type . IsGenericTypeDefinition ) )
289
+ || ( ! allowEnum && type . IsEnum ) )
291
290
continue ;
292
291
293
292
if ( type . FullName . Contains ( "PrivateImplementationDetails" )
0 commit comments