Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("App: Launched with the WebBrowserCreator.");
            WebBrowserCreator webCreator = new WebBrowserCreator();

            Console.WriteLine("Client: I'm not aware of the creator's class," + "but it still works.\n" + webCreator.PlatformInfo());
            Console.WriteLine("");
            Console.WriteLine("App: Launched with the MobileAppCretor.");
            MobileAppCretor mobileCreator = new MobileAppCretor();

            Console.WriteLine("Client: I'm not aware of the creator's class," + "but it still works.\n" + mobileCreator.PlatformInfo());
        }
Пример #2
0
        public FactoryPatternStrategy()
        {
            Console.WriteLine("App: Launched with the WebBrowserCreator.");
            WebBrowserCreator webCreator = new WebBrowserCreator();

            Console.WriteLine("Client: I'm not aware of the creator's class," + "but it still works.\n" + webCreator.PlatformInfo());
            Console.WriteLine("");
            Console.WriteLine("App: Launched with the MobileAppCretor.");
            MobileAppCretor mobileCreator = new MobileAppCretor();

            Console.WriteLine("Client: I'm not aware of the creator's class," + "but it still works.\n" + mobileCreator.PlatformInfo());
        }