public void startTest() { BData b1 = new BData() { name = "Firster", value = 111 }; Console.WriteLine("b1 [" + b1.name + ", " + b1.value + "]"); List <BData> list1 = new List <BData>() { b1, new BData() { name = "Secondr", value = 222 } }; Console.WriteLine("-- list1 " + list1.Count); foreach (BData b in list1) { Console.WriteLine(" " + b.name + ", " + b.value); } list1.Add(new BData() { name = "Thirder", value = 333 }); Console.WriteLine("-- list1 " + list1.Count); foreach (BData b in list1) { Console.WriteLine(" " + b.name + ", " + b.value); } }
public CheckNew() { Console.ForegroundColor = ConsoleColor.DarkYellow; DSingle = new BData(); DList = new List <BData>(); }