コード例 #1
0
        static Application ConfigureApplication()
        {
            Application       app;
            ITransportFactory transportFactory;
            string            company = "99";

            if (company == "Uber")
            {
                transportFactory = new UberTransport();
            }
            else
            {
                transportFactory = new NineNineTransport();
            }

            app = new Application(transportFactory);

            return(app);
        }
コード例 #2
0
        static Application ConfigureApplication()
        {
            Application app;

            ITransportFactory transportFactory = null;
            string            company          = "lime";

            if (company == "uber")
            {
                transportFactory = new UberTransport();
            }
            else if (company == "ninenine")
            {
                transportFactory = new NineNineTransport();
            }
            else if (company == "lime")
            {
                transportFactory = new LimeTransport();
            }

            app = new Application(transportFactory);

            return(app);
        }
コード例 #3
0
        static Aplicacao CriarAplicacao()
        {
            Aplicacao app;

            ITransportFactory transportFactory;
            string            companhia = "99";

            if (companhia == "Uber")
            {
                transportFactory = new UberTransport();
            }
            else if (companhia == "99")
            {
                transportFactory = new NineNineTransport();
            }
            else
            {
                transportFactory = new LimeTransport();
            }

            app = new Aplicacao(transportFactory);

            return(app);
        }