APISampleUnitTestsCS.FAQ.IfStatementIfKeywordAndTypeDeclarationWalker.Visit C# (CSharp) Метод

Visit() публичный Метод

public Visit ( SyntaxNode node ) : void
node SyntaxNode
Результат void
            public override void Visit(SyntaxNode node)
            {
                // If you need to visit all SyntaxNodes of a particular base type that can never
                // appear directly in a syntax tree then this would be the place to check for that.
                // For example, TypeDeclarationSyntax is a base type for all the type declarations (like
                // ClassDeclarationSyntax and StructDeclarationSyntax) that can appear in a syntax tree.
                if (node is TypeDeclarationSyntax)
                {
                    Results.AppendLine();
                    Results.Append("Visiting ");
                    Results.Append(node.GetType().Name);
                    Results.Append(" (Kind = ");
                    Results.Append(node.Kind.ToString());
                    Results.Append(")");
                }

                base.Visit(node);
            }