コード例 #1
0
ファイル: Program.cs プロジェクト: gitHubbie007/CST276Lab6
        static void Main(string[] args)
        {
            Order order = new Order();

            OrderDecorator shippingOrder = new ExpressDeliveryOrderDecorator(order);
            OrderDecorator visaOrder = new Visa(order);
            OrderDecorator americanExpOrder = new AmericanExpress(order);

            order.AddItem("BroncoHats", 2, 1.5, 0.2);
            order.AddItem("BroncoGloves", 1, 3.0, 0.5);
            order.AddItem("BroncoSocks", 6, 1.9, 0.1);
            order.AddItem("BroncoBanners", 3, 8.0, 1.5);
            order.AddItem("BroncoFootBalls", 4, 5.6, 0.6);
            order.AddItem("BroncoJerseys", 2, 2.3, 0.4);

            shippingOrder.PrintOrderItems();
            visaOrder.PrintOrderItems();
            americanExpOrder.PrintOrderItems();
            Console.ReadLine();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: Lydiasaurus/Personal
        static void Main(string[] args)
        {
            Order order = new Order();

            order.AddItem("BroncoHats     ", 2, 1.5, 0.2);
            order.AddItem("BroncoGloves   ", 1, 3.0, 0.5);
            order.AddItem("BroncoSocks    ", 6, 1.9, 0.1);
            order.AddItem("BroncoBanners  ", 3, 8.0, 1.5);
            order.AddItem("BroncoFootBalls", 4, 5.6, 0.6);
            order.AddItem("BroncoJerseys  ", 2, 2.3, 0.4);

            ExpressDeliveryOrderDecorator express       = new ExpressDeliveryOrderDecorator(order);
            VisaCreditOrderDecorator visa               = new VisaCreditOrderDecorator(order);
            AmericanExpressCreditOrderDecorator amex    = new AmericanExpressCreditOrderDecorator(order);

            order.PrintOrderItems();
            express.AddItem("BroncoTShirts  ", 2, 2.3, 0.4);
            express.PrintOrderItems();
            visa.PrintOrderItems();
            amex.PrintOrderItems();

            Console.ReadLine();
        }