Пример #1
0
        static void Main(string[] args)
        {
            IFactory <Doll> factory = new DollFactory();
            var             boxes   = BoxHelper.GenerateBoxes <Doll>(50, factory.MakeElement);

            Parallel.ForEach(boxes, b =>
            {
                Console.WriteLine(b.ToString());
            });
        }
Пример #2
0
        static void Main(string[] args)
        {
            IFactory <Doll> factory = new DollFactory();
            var             boxes   = BoxHelper.GenerateBoxes <Doll>(50, factory.MakeElement);

            /*var doll = new Doll();
             * var box = new Box<Doll>();
             * box.Put(doll);
             *
             * var box2 = new Box<Car>();
             * box2.Put(new Car());*/
        }