diff --git a/ICSharpCode.NRefactory/TypeSystem/DomRegion.cs b/ICSharpCode.NRefactory/TypeSystem/DomRegion.cs index b9d31cae61..dd1f9e9745 100644 --- a/ICSharpCode.NRefactory/TypeSystem/DomRegion.cs +++ b/ICSharpCode.NRefactory/TypeSystem/DomRegion.cs @@ -60,6 +60,18 @@ namespace ICSharpCode.NRefactory.TypeSystem } } + public AstLocation Begin { + get { + return new AstLocation (beginLine, beginColumn); + } + } + + public AstLocation End { + get { + return new AstLocation (endLine, endColumn); + } + } + public DomRegion(string fileName, int beginLine, int beginColumn, int endLine, int endColumn) { this.fileName = fileName; @@ -69,15 +81,33 @@ namespace ICSharpCode.NRefactory.TypeSystem this.endColumn = endColumn; } - public DomRegion(string fileName, int beginLine, int beginColumn) + public DomRegion (string fileName, int beginLine, int beginColumn) { this.fileName = fileName; - this.beginLine = beginLine; + this.beginLine = beginLine; this.beginColumn = beginColumn; this.endLine = -1; this.endColumn = -1; } + public DomRegion (string fileName, AstLocation begin, AstLocation end) + { + this.fileName = fileName; + this.beginLine = begin.Line; + this.beginColumn = begin.Column; + this.endLine = end.Line; + this.endColumn = end.Column; + } + + public DomRegion (string fileName, AstLocation begin) + { + this.fileName = fileName; + this.beginLine = begin.Line; + this.beginColumn = begin.Column; + this.endLine = -1; + this.endColumn = -1; + } + /// /// Returns true, if the given coordinates (line, column) are in the region. /// This method assumes that for an unknown end the end line is == -1