public bool AddMacros(Assembly assembly, bool writeToSink = true)
{
bool any = false;
foreach (Type type in assembly.GetExportedTypes()) {
if (!type.IsGenericTypeDefinition &&
type.GetCustomAttributes(typeof(ContainsMacrosAttribute), true).Any())
{
if (writeToSink && Sink.IsEnabled(Severity.Verbose))
Sink.Write(Severity.Verbose, assembly.GetName().Name, "Adding macros in type '{0}'", type);
any = AddMacros(type) || any;
}
}
if (!any && writeToSink)
Sink.Warning(assembly, "No macros found");
return any;
}