Пример #1
0
 void RunCSharpNRefactoryVisitorClick(object sender, EventArgs e)
 {
     try {
         Clear();
         using (NRefactory.IParser parser = NRefactory.ParserFactory.CreateParser(NRefactory.SupportedLanguage.CSharp, new StringReader(codeTextBox.Text))) {
             parser.ParseMethodBodies = false;
             parser.Parse();
             NRefactoryAstVisitor visitor = new NRefactoryAstVisitor(this);
             visitor.VisitCompilationUnit(parser.CompilationUnit, null);
         }
     } catch (Exception ex) {
         walkerOutputTextBox.Text = ex.ToString();
     }
 }
Пример #2
0
		void RunCSharpNRefactoryVisitorClick(object sender, EventArgs e)
		{
			try {
				Clear();
				using (NRefactory.IParser parser = NRefactory.ParserFactory.CreateParser(NRefactory.SupportedLanguage.CSharp, new StringReader(codeTextBox.Text))) {
					parser.ParseMethodBodies = false;
					parser.Parse();
					NRefactoryAstVisitor visitor = new NRefactoryAstVisitor(this);
					visitor.VisitCompilationUnit(parser.CompilationUnit, null);
				}
			} catch (Exception ex) {
				walkerOutputTextBox.Text = ex.ToString();
			}			
		}