Ejemplo n.º 1
0
        public void Provide(ICachedNamedTypeSymbol cachedNamedTypeSymbol, ComponentData data)
        {
            var attributes = cachedNamedTypeSymbol
                             .GetAttributes(nameof(CleanupAttribute))
                             .ToArray();

            if (attributes.Any())
            {
                var cleanupData = attributes
                                  .Select(x => x.ConstructorArguments[0].Value)
                                  .Cast <CleanupMode>()
                                  .ToArray();

                data.SetCleanupData(cleanupData);
            }
        }