ICSharpCode.NRefactory.CSharp.CSharpOutputVisitor.VisitSyntaxTree C# (CSharp) Метод

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

public VisitSyntaxTree ( SyntaxTree syntaxTree ) : void
syntaxTree SyntaxTree
Результат void
		public virtual void VisitSyntaxTree(SyntaxTree syntaxTree)
		{
			// don't do node tracking as we visit all children directly
			foreach (AstNode node in syntaxTree.Children) {
				node.AcceptVisitor(this);
				MaybeNewLinesAfterUsings(node);
			}
		}
		

Usage Example

Пример #1
0
        private void FormatDocument_Click( object sender, RoutedEventArgs e )
        {
            CSharpFormattingOptions policy = FormattingOptionsFactory.CreateAllman();
            CSharpParser parser = new CSharpParser();
            SyntaxTree tree = parser.Parse( scriptTextBox.Text );
            StringWriter writer = new StringWriter();
            CSharpOutputVisitor outputVisitor = new CSharpOutputVisitor( writer, policy );
            outputVisitor.VisitSyntaxTree( tree );

            scriptTextBox.Text = writer.ToString();
        }
CSharpOutputVisitor