From 11ab326cc3071cff4deba4b0ce7c73400a7a7702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Sat, 3 Mar 2012 10:20:56 +0100 Subject: [PATCH] Readded the 'IsInside' function that checks the position inclusive the end location. --- ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs | 24 +++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs b/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs index 411579d8be..cca4d85391 100644 --- a/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs +++ b/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs @@ -651,7 +651,7 @@ namespace ICSharpCode.NRefactory.CSharp /// Returns true, if the given coordinates (line, column) are in the node. /// /// - /// True, if the given coordinates are between StartLocation and EndLocation (inclusive); otherwise, false. + /// True, if the given coordinates are between StartLocation and EndLocation (exclusive); otherwise, false. /// public bool Contains (int line, int column) { @@ -669,6 +669,28 @@ namespace ICSharpCode.NRefactory.CSharp return this.StartLocation <= location && location < this.EndLocation; } + /// + /// Returns true, if the given coordinates (line, column) are in the node. + /// + /// + /// True, if the given coordinates are between StartLocation and EndLocation (inclusive); otherwise, false. + /// + public bool IsInside (int line, int column) + { + return IsInside (new TextLocation (line, column)); + } + + /// + /// Returns true, if the given coordinates are in the node. + /// + /// + /// True, if location is between StartLocation and EndLocation (inclusive); otherwise, false. + /// + public bool IsInside (TextLocation location) + { + return this.StartLocation <= location && location <= this.EndLocation; + } + public override void AddAnnotation (object annotation) { if (this.IsNull)