예제 #1
0
        static void Main()
        {
            GenericList<Test> list = new GenericList<Test>(10);

            for (int i = 0; i < list.Length; i++)
            {
                Test testObject = new Test();
                testObject.Id = i;
                testObject.Content = "Some text " + i;
                list.Add(testObject);
            }

            Console.WriteLine("Element at position 3, content: {0}", list[3].Content);
            list.RemoveAtPosition(3);
            Console.WriteLine("Element at position 3 after Remove, content: {0}", list[3].Content);
            list.InsertAtPosition(3, new Test() { Id = 3, Content = "Some text 3" });
            Console.WriteLine("Element at position 3 after Insert, content: {0}", list[3].Content);
        }