Exemplo n.º 1
0
 public IEnumerator <IConversationTreeNode> GetEnumerator()
 {
     if (ConversationTreeNodeBase.IsChronologicalSortOrder(this.SortOrder))
     {
         foreach (IConversationTreeNode node in this.FlatSortNodes)
         {
             yield return(node);
         }
     }
     else
     {
         foreach (IConversationTreeNode firstLevelIteration in this.childNodes)
         {
             if (this.SortOrder != ConversationTreeSortOrder.DeepTraversalDescending)
             {
                 yield return(firstLevelIteration);
             }
             foreach (IConversationTreeNode secondLevelIteration in firstLevelIteration)
             {
                 yield return(secondLevelIteration);
             }
             if (this.SortOrder == ConversationTreeSortOrder.DeepTraversalDescending)
             {
                 yield return(firstLevelIteration);
             }
         }
     }
     yield break;
 }
Exemplo n.º 2
0
 public void SortChildNodes(ConversationTreeSortOrder sortOrder)
 {
     if (this.SortOrder == sortOrder)
     {
         return;
     }
     if (ConversationTreeNodeBase.IsChronologicalSortOrder(sortOrder))
     {
         this.FlatSortNodes = this.CalculateFlatSortNodes(sortOrder);
     }
     else
     {
         this.TraversalSortChildNodes(sortOrder);
     }
     this.SortOrder = sortOrder;
 }