Permalink
Browse files

Added contains method.

  • Loading branch information...
1 parent d4d9ffd commit 1feb0fc502148bd10ca782102607d6ae2a0cfbb8 @mkrueger mkrueger committed May 26, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs
@@ -655,6 +655,16 @@ public AstNode GetCSharpNodeBefore (AstNode node)
return null;
}
+ public bool Contains (int line, int column)
+ {
+ return Contains (new AstLocation (line, column));
+ }
+
+ public bool Contains (AstLocation location)
+ {
+ return this.StartLocation <= location && location < this.EndLocation;
+ }
+
// the Root role must be available when creating the null nodes, so we can't put it in the Roles class
static readonly Role<AstNode> RootRole = new Role<AstNode>("Root");

0 comments on commit 1feb0fc

Please sign in to comment.