Browse Source

NRefactory AstNode: add DescendantsAndSelf property.

pull/100/head
Daniel Grunwald 15 years ago
parent
commit
f4da816fc4
  1. 9
      NRefactory/ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs

9
NRefactory/ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs

@ -157,6 +157,15 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
/// <summary>
/// Gets all descendants of this node (including this node itself).
/// </summary>
public IEnumerable<AstNode> DescendantsAndSelf {
get {
return Utils.TreeTraversal.PreOrder(this, n => n.Children);
}
}
/// <summary> /// <summary>
/// Gets the first child with the specified role. /// Gets the first child with the specified role.
/// Returns the role's null object if the child is not found. /// Returns the role's null object if the child is not found.

Loading…
Cancel
Save