Ejemplo n.º 1
0
        public static List <IConversationTreeNode> TrimToNewest(List <IConversationTreeNode> relevantNodes, int maxItemsToReturn)
        {
            List <IConversationTreeNode> list = new List <IConversationTreeNode>(relevantNodes);

            ConversationTreeNodeBase.SortByDate(list);
            if (list.Count > maxItemsToReturn)
            {
                list.RemoveRange(0, list.Count - maxItemsToReturn);
            }
            return(list);
        }
Ejemplo n.º 2
0
        private List <IConversationTreeNode> FlatSortChildNodes(ConversationTreeSortOrder sortOrder)
        {
            List <IConversationTreeNode> flatSortNodes = new List <IConversationTreeNode>(0);

            this.ApplyActionToChild(delegate(IConversationTreeNode treeNode)
            {
                treeNode.SortOrder = sortOrder;
                if (treeNode.HasData)
                {
                    flatSortNodes.Add(treeNode);
                }
            });
            ConversationTreeNodeBase.SortByDate(flatSortNodes, sortOrder == ConversationTreeSortOrder.ChronologicalAscending);
            return(flatSortNodes);
        }
Ejemplo n.º 3
0
 public static void SortByDate(List <IConversationTreeNode> nodes)
 {
     ConversationTreeNodeBase.SortByDate(nodes, true);
 }