當前位置: 首頁>>代碼示例>>C#>>正文


C# MapNode.SortChildren方法代碼示例

本文整理匯總了C#中MindMate.Model.MapNode.SortChildren方法的典型用法代碼示例。如果您正苦於以下問題:C# MapNode.SortChildren方法的具體用法?C# MapNode.SortChildren怎麽用?C# MapNode.SortChildren使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MindMate.Model.MapNode的用法示例。


在下文中一共展示了MapNode.SortChildren方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SortChildren_WithRootNodeSortABC_Asc

        public void SortChildren_WithRootNodeSortABC_Asc()
        {
            var r = new MapNode(new MapTree(), "r");
            var c1 = new MapNode(r, "C");
            var c11 = new MapNode(c1, "c11");
            var c12 = new MapNode(c1, "c12");
            var c121 = new MapNode(c12, "c121");
            var c13 = new MapNode(c1, "c13");
            var c131 = new MapNode(c13, "c131");
            var c1311 = new MapNode(c131, "c1311");
            var c2 = new MapNode(r, "B");
            var c3 = new MapNode(r, "C", NodePosition.Left);
            var c31 = new MapNode(c3, "c31");
            var c32 = new MapNode(c3, "c32");
            var c4 = new MapNode(r, "A");
            var c5 = new MapNode(r, "F");
            var c6 = new MapNode(r, "D");
            var c7 = new MapNode(r, "E");

            r.SortChildren((node1, node2) => string.CompareOrdinal(node1.Text, node2.Text));

            Assert.AreEqual(c4, r.FirstChild);
            Assert.AreEqual(c2, r.FirstChild.Next);
            Assert.AreEqual(c7, r.LastChild.Previous);
            Assert.AreEqual(c5, r.LastChild);
        }
開發者ID:,項目名稱:,代碼行數:26,代碼來源:

示例2: SortChildren_OneChild

        public void SortChildren_OneChild()
        {
            var r = new MapNode(new MapTree(), "r");
            var c1 = new MapNode(r, "C");
            var c11 = new MapNode(c1, "c11");
            var c12 = new MapNode(c1, "c12");
            var c121 = new MapNode(c12, "c121");
            var c13 = new MapNode(c1, "c13");
            var c131 = new MapNode(c13, "c131");
            var c1311 = new MapNode(c131, "c1311");

            c131.SortChildren((node1, node2) => string.CompareOrdinal(node2.Text, node1.Text));

            Assert.AreEqual(c1311, c131.FirstChild);
            Assert.AreEqual(c1311, c131.LastChild);
        }
開發者ID:,項目名稱:,代碼行數:16,代碼來源:

示例3: SortChildren

        public void SortChildren()
        {
            var r = new MapNode(new MapTree(), "r");
            var c1 = new MapNode(r, "C");
            var c11 = new MapNode(c1, "6");
            var c12 = new MapNode(c1, "2");
            var c13 = new MapNode(c1, "4");
            var c14 = new MapNode(c1, "7");
            var c15 = new MapNode(c1, "1");
            var c16 = new MapNode(c1, "5");
            var c17 = new MapNode(c1, "3");
            var c121 = new MapNode(c12, "c121");
            var c2 = new MapNode(r, "B");
            var c3 = new MapNode(r, "C", NodePosition.Left);
            var c31 = new MapNode(c3, "c31");
            var c32 = new MapNode(c3, "c32");

            c1.SortChildren((node1, node2) => string.CompareOrdinal(node1.Text, node2.Text));

            Assert.AreEqual(c15, c1.FirstChild);
            Assert.AreEqual(c12, c1.FirstChild.Next);
            Assert.AreEqual(c11, c1.LastChild.Previous);
            Assert.AreEqual(c14, c1.LastChild);
        }
開發者ID:,項目名稱:,代碼行數:24,代碼來源:


注:本文中的MindMate.Model.MapNode.SortChildren方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。