static void Main(string[] args)
        {
            //Case1();
            AutomobileFactory factory = AutomobileFactory.GetInstance();
            IAutomobile       auto1   = factory.Make(AutoType.AUDI);

            Console.WriteLine(auto1.GetType());
            auto1.Start();

            auto1.Stop();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            //Case1();
            IAutomobile       mobile;
            AutomobileFactory factory = AutomobileFactory.GetInstance();

            mobile = factory.Make(AutoType.AUDI);
            mobile.Start();
            mobile.Stop();
            mobile = factory.Make(AutoType.BMW);
            mobile.Start();
            mobile.Stop();
        }