protected AttributedNode GetParentMember(Location start, Location end) { using (IParser parser = ParserFactory.CreateParser(SupportedLanguage.CSharp, new StringReader(this.currentDocument.Text))) { parser.Parse(); if (parser.Errors.Count > 0) { MessageService.ShowException(null, parser.Errors.ErrorOutput); return null; } FindMemberVisitor fmv = new FindMemberVisitor(start, end); parser.CompilationUnit.AcceptVisitor(fmv, null); return fmv.Member; } }
protected ParametrizedNode GetParentMember(int startLine, int startColumn, int endLine, int endColumn) { using (IParser parser = ParserFactory.CreateParser(SupportedLanguage.CSharp, new StringReader(this.currentDocument.TextContent))) { parser.Parse(); if (parser.Errors.Count > 0) { MessageService.ShowError(null, parser.Errors.ErrorOutput); return null; } FindMemberVisitor fmv = new FindMemberVisitor(startColumn, startLine, endColumn, endLine); parser.CompilationUnit.AcceptVisitor(fmv, null); return fmv.Member; } }