public string GetPathAsString() { Stack <PathAtom> copy = new Stack <PathAtom>(path); copy = GenericStack <PathAtom> .InvertStack(path); StringBuilder result = new StringBuilder(""); while (copy.Count != 0) { result.Append(copy.Pop().ToString() + " -> "); } return(result.ToString()); }
public XElement GetPathAsElement() { Stack <PathAtom> copy = new Stack <PathAtom>(path); copy = GenericStack <PathAtom> .InvertStack(path); XElement result = new XElement(copy.Pop().GetAtom()); XElement child = result; while (copy.Count > 0) { child.Add(copy.Pop().GetAtom()); child = child.Descendants().First(); } return(result); }
public void InvertIt() { path = GenericStack <PathAtom> .InvertStack(path); }