diff --git a/src/Generator/Types/TypeMap.cs b/src/Generator/Types/TypeMap.cs index e25fa961..90464d05 100644 --- a/src/Generator/Types/TypeMap.cs +++ b/src/Generator/Types/TypeMap.cs @@ -80,17 +80,21 @@ namespace Cxxi.Types foreach (var assembly in loadedAssemblies) { var types = assembly.FindDerivedTypes(typeof(TypeMap)); + SetupTypeMaps(types); + } + } + + private void SetupTypeMaps(IEnumerable types) + { + foreach (var typeMap in types) + { + var attrs = typeMap.GetCustomAttributes(); + if (attrs == null) continue; - foreach (var typeMap in types) + foreach (var attr in attrs) { - var attrs = typeMap.GetCustomAttributes(); - if (attrs == null) continue; - - foreach (var attr in attrs) - { - Console.WriteLine("Found typemap: {0}", attr.Type); - TypeMaps[attr.Type] = typeMap; - } + Console.WriteLine("Found typemap: {0}", attr.Type); + TypeMaps[attr.Type] = typeMap; } } }