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


C# ListMaker.Add方法代碼示例

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


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

示例1: RemoveListDuplicates10K

        public void RemoveListDuplicates10K()
        {
            const int big = 10000;
            ListMaker LMakerLarge = new ListMaker();
            LMakerLarge.Clear();
            for(int i=1; i<big; i++)
                LMakerLarge.Add(new Article(i.ToString()));

            LMakerLarge.Add(new Article("1"));

            Assert.AreEqual(LMakerLarge.Count, big);

            LMakerLarge.RemoveListDuplicates();

            Assert.AreEqual(LMakerLarge.Count, big-1, "Duplicate removed");
            Assert.IsTrue(LMakerLarge.Contains(new Article("1")), "First instance of article retained");
        }
開發者ID:svn2github,項目名稱:awb,代碼行數:17,代碼來源:MiscellaneousTests.cs

示例2: RemoveListDuplicatesSimple

        public void RemoveListDuplicatesSimple()
        {
            ListMaker LMakerRLD = new ListMaker();
            LMakerRLD.Add(new Article("A"));
            LMakerRLD.Add(new Article("B"));
            LMakerRLD.Add(new Article("C"));
            LMakerRLD.Add(new Article("A"));

            LMakerRLD.RemoveListDuplicates();

            Assert.AreEqual(LMakerRLD.Count, 3, "Duplicate removed");
            foreach(Article a in LMakerRLD)
            {
                Assert.AreEqual(a, "A", "Duplicates removed from end of list");
                break;
            }
        }
開發者ID:svn2github,項目名稱:awb,代碼行數:17,代碼來源:MiscellaneousTests.cs

示例3: FilterNonMainArticlesVolume

        public void FilterNonMainArticlesVolume()
        {
            const int big = 500;
            ListMaker LMakerLarge = new ListMaker();
            LMakerLarge.Clear();
            for(int i=1; i<big; i++)
                LMakerLarge.Add(i.ToString());

            LMakerLarge.Add("Talk:Me");

            LMakerLarge.FilterNonMainArticles();
            Assert.AreEqual(LMakerLarge.Count, big-1, "Non-mainspace article removed");
        }
開發者ID:svn2github,項目名稱:awb,代碼行數:13,代碼來源:MiscellaneousTests.cs

示例4: GetArticleList

        public void GetArticleList()
        {
            ListMaker LMaker = new ListMaker();
            LMaker.Add("A");
            LMaker.Add("B");

            Assert.AreEqual(2, LMaker.GetArticleList().Count);

            LMaker.Items.SetSelected(0, true);
            LMaker.Items.SetSelected(1, true);

            Assert.AreEqual(2, LMaker.GetSelectedArticleList().Count);

            LMaker.Items.SetSelected(1, false);

            Assert.AreEqual(1, LMaker.GetSelectedArticleList().Count);
            Assert.AreEqual(2, LMaker.GetArticleList().Count);
        }
開發者ID:svn2github,項目名稱:awb,代碼行數:18,代碼來源:MiscellaneousTests.cs

示例5: FilterNonMainArticles

        public void FilterNonMainArticles()
        {
            ListMaker LMaker = new ListMaker();
            LMaker.Add("One");
            LMaker.Add("Two");
            LMaker.Add("Talk:Three");
            LMaker.Add("Four");
            LMaker.Add("Talk:Five");
            LMaker.Add("Talk:Five2");
            LMaker.Add("Six");

            LMaker.FilterNonMainArticles();
            Assert.AreEqual(4, LMaker.NumberOfArticles);
        }
開發者ID:svn2github,項目名稱:awb,代碼行數:14,代碼來源:MiscellaneousTests.cs

示例6: AddList

        public void AddList()
        {
            ListMaker LMaker = new ListMaker();
            List<Article> l = new List<Article>();

            l.Add(new Article("A"));
            l.Add(new Article("B"));

            LMaker.Add("A");
            LMaker.Add("B");

            LMaker.FilterDuplicates = true;

            LMaker.Add(l);
            Assert.AreEqual(2, LMaker.NumberOfArticles);

            l.Add(new Article("C"));
            LMaker.Add(l);
            Assert.AreEqual(3, LMaker.NumberOfArticles);

            l.Add(new Article("C"));
            l.Add(new Article("C"));
            l.Add(new Article("C"));
            l.Add(new Article("C"));
            LMaker.Add("D");
            LMaker.Add(l);
            Assert.AreEqual(4, LMaker.NumberOfArticles);
        }
開發者ID:svn2github,項目名稱:awb,代碼行數:28,代碼來源:MiscellaneousTests.cs

示例7: ListComparerSimple

        public void ListComparerSimple()
        {
            ListMaker LMaker = new ListMaker();
            LMaker.Add(new Article("A"));
            LMaker.Add(new Article("B"));
            LMaker.Add(new Article("C"));
            LMaker.Add(new Article("C")); // duplicate, removed during compare
            System.Windows.Forms.ListBox lb1 = new System.Windows.Forms.ListBox();
            System.Windows.Forms.ListBox lb2 = new System.Windows.Forms.ListBox();
            System.Windows.Forms.ListBox lb3 = new System.Windows.Forms.ListBox();

            List<Article> articles = new List<Article>();
            articles.Add(new Article("A"));
            articles.Add(new Article("D"));
            articles.Add(new Article("E"));

            ListComparer.CompareLists(LMaker, articles, lb1, lb2, lb3);

            // unique in 1
            Assert.IsTrue(lb1.Items.Contains("B"));
            Assert.IsTrue(lb1.Items.Contains("C"));
            Assert.IsFalse(lb1.Items.Contains("A"));
            Assert.AreEqual(lb1.Items.Count, 2);

            // unique in 2
            Assert.IsFalse(lb2.Items.Contains("A"));
            Assert.IsTrue(lb2.Items.Contains("D"));
            Assert.IsTrue(lb2.Items.Contains("E"));
            Assert.AreEqual(lb2.Items.Count, 2);

            // common to both
            Assert.IsTrue(lb3.Items.Contains("A"));
            Assert.AreEqual(lb3.Items.Count, 1);
        }
開發者ID:svn2github,項目名稱:awb,代碼行數:34,代碼來源:MiscellaneousTests.cs

示例8: ListComparer10K

        public void ListComparer10K()
        {
            const int big = 10000;
            ListMaker LMakerC10K = new ListMaker();

            for(int i=0; i<big; i++)
                LMakerC10K.Add(new Article(i.ToString()));

            LMakerC10K.Add(new Article("A"));
            LMakerC10K.Add(new Article("B"));

            System.Windows.Forms.ListBox lb1 = new System.Windows.Forms.ListBox();
            System.Windows.Forms.ListBox lb2 = new System.Windows.Forms.ListBox();
            System.Windows.Forms.ListBox lb3 = new System.Windows.Forms.ListBox();

            List<Article> articlesC = new List<Article>();
            for(int i=0; i<big; i++)
                articlesC.Add(new Article(i.ToString()));

            articlesC.Add(new Article("C"));
            articlesC.Add(new Article("D"));

            ListComparer.CompareLists(LMakerC10K, articlesC, lb1, lb2, lb3);

            // unique in 1
            Assert.IsTrue(lb1.Items.Contains("A"));
            Assert.IsTrue(lb1.Items.Contains("B"));

            // unique in 2
            Assert.IsTrue(lb2.Items.Contains("C"));
            Assert.IsTrue(lb2.Items.Contains("D"));

            // common to both
            Assert.IsTrue(lb3.Items.Contains("1"));
            Assert.AreEqual(lb3.Items.Count, big);
        }
開發者ID:svn2github,項目名稱:awb,代碼行數:36,代碼來源:MiscellaneousTests.cs

示例9: AddListToListMaker

 private void AddListToListMaker(ListMaker lm, IEnumerable<Article> lb)
 {
     List<Article> articles = new List<Article>();
     articles.AddRange(lb);
     lm.Add(articles);
 }
開發者ID:svn2github,項目名稱:autowikibrowser,代碼行數:6,代碼來源:ListComparer.cs


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