コード例 #1
0
        static void Main(string[] args)
        {
            Console.Title = "Demo of the Adapter Pattern";
            ITarget adapter = new VendorAdapter();

            foreach (string brand in adapter.GetCars())
            {
                Console.WriteLine("Brand: " + brand);
            }
            Console.ReadLine();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            ITarget adapter = new VendorAdapter();

            foreach (string product in adapter.GetProducts())
            {
                Console.WriteLine(product);
            }

            // Wait for user
            Console.ReadKey();
        }
コード例 #3
0
        static void Main(string[] args)
        {
            ITarget adapter = new VendorAdapter();

            foreach (string product in adapter.GetProducts())
            {
                Console.WriteLine(product);
            }

            // Wait for user
            Console.ReadKey();
        }