using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; namespace XamlNameReferenceGenerator { internal class NameReferenceSyntaxReceiver : ISyntaxReceiver { public List CandidateClasses { get; } = new List(); public void OnVisitSyntaxNode(SyntaxNode syntaxNode) { if (syntaxNode is ClassDeclarationSyntax classDeclarationSyntax && classDeclarationSyntax.AttributeLists.Count > 0) CandidateClasses.Add(classDeclarationSyntax); } } }