/// <summary>
 /// Indexes the string writer delegate.
 /// </summary>
 /// <param name="current">The current.</param>
 /// <param name="sb">The sb.</param>
 private void IndexStringWriterDelegate(TreeItem <T> current, StringBuilder sb)
 {
     sb.Append('\t', current.Level);
     sb.AppendLine("[" + current.Id + "]");
 }
 /// <summary>
 /// Sets the enumerator to its initial position, which is before the first element in the collection.
 /// </summary>
 public void Reset()
 {
     _current = null;
 }
 /// <summary>
 /// Indexes the XML writer delegate.
 /// </summary>
 /// <param name="current">The current.</param>
 /// <param name="xtw">The XTW.</param>
 private void IndexXmlWriterDelegate(TreeItem <T> current, XmlTextWriter xtw)
 {
     xtw.WriteStartElement("TreeItem");
     xtw.WriteAttributeString("Id", current.Id);
     xtw.WriteEndElement();             //TreeItem
 }
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     _current = null;
     _globalCollection.Clear();
     _rootItems.Clear();
 }