private IList<IBooParseTreeNode> FlattenUp(IBooParseTreeNode node)
{
IList<IBooParseTreeNode> flattened = new IntellisenseNodeList();
IBooParseTreeNode parent = node;
while ((parent = parent.Parent) != null)
{
foreach (IBooParseTreeNode sibling in parent.Children)
{
flattened.Add(sibling);
}
flattened.Add(parent);
}
return flattened;
}