private StepInfo findPrev(StepInfo child)
{
StepInfo parent = child.Parent;
int index = parent.Children.IndexOf(child);
if (IsRoot(parent))
{
if (index > 0)
return Last(parent.Children.ElementAt(index - 1));
else
return new StepInfo("");
}
else
{
if (index > 0)
{
StepInfo pStep = parent.Children.ElementAt(index - 1);
if (pStep.Children.Count == 0)
return pStep;
else
return findLast(pStep);
}
else
return parent;
}
}