本文整理汇总了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");
}
示例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;
}
}
示例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");
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例9: AddListToListMaker
private void AddListToListMaker(ListMaker lm, IEnumerable<Article> lb)
{
List<Article> articles = new List<Article>();
articles.AddRange(lb);
lm.Add(articles);
}