Пример #1
0
 private void News(AB ab, string b, ref int count, out IList <AB> list)
 {
     list  = new List <AB>();
     ab.Id = 10;
     b     = "引用类型";
     count = 20;
     list.Add(new AB {
         Id = 1
     });
     list.Add(new AB {
         Id = 2
     });
     list.Add(new AB {
         Id = 3
     });
 }
Пример #2
0
        public void Tests()
        {
            string     测试    = "a";
            int        count = 0;
            AB         a     = new AB();
            IList <AB> list;

            News(a, 测试, ref count, out list);
            Console.WriteLine(a.Id);
            Console.WriteLine(测试);
            Console.WriteLine(count);

            Console.WriteLine();
            foreach (var item in list)
            {
                Console.WriteLine(item.Id);
            }
        }