本文整理汇总了C#中System.Collections.ArrayList.Typed方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayList.Typed方法的具体用法?C# ArrayList.Typed怎么用?C# ArrayList.Typed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.ArrayList
的用法示例。
在下文中一共展示了ArrayList.Typed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestToSublist_OnTypedList_WithOffset_WrapsRemaining
public void TestToSublist_OnTypedList_WithOffset_WrapsRemaining()
{
ArrayList list = new ArrayList() { 1, 2, 3 };
var typed = list.Typed<int>();
var sublist = typed.ToSublist(1);
Assert.AreSame(typed, sublist.List, "The back list was not set.");
Assert.AreEqual(1, sublist.Offset, "The offset was not zero.");
Assert.AreEqual(2, sublist.Count, "The count was wrong.");
}
示例2: TestToSublist_OnTypedList_WrapsEntireList
public void TestToSublist_OnTypedList_WrapsEntireList()
{
ArrayList list = new ArrayList();
var typed = list.Typed<int>();
var sublist = typed.ToSublist();
Assert.AreSame(typed, sublist.List, "The back list was not set.");
Assert.AreEqual(0, sublist.Offset, "The offset was not zero.");
Assert.AreEqual(typed.Count, sublist.Count, "The count was wrong.");
}
示例3: TestTyped_ArrayList_WrapsList
public void TestTyped_ArrayList_WrapsList()
{
ArrayList list = new ArrayList();
var typed = list.Typed<int>();
Assert.AreSame(list, typed.List, "The list was not wrapped.");
}