private static void TouringBike()
        {
            AbstractRoadBike roadBike = new Touring(BikeColor.Gold, new NarrowWheel(12));
            BikeBuilder      builder  = new RoadBikeBuilder(roadBike);
            BikeDirector     director = new RoadBikeDirector();
            IBicycle         bicycle  = director.Build(builder);

            Console.WriteLine(bicycle);
        }
Exemple #2
0
        static void DecoratorDemo()
        {
            IBicycle tourBike = new Touring(new NarrowWheel(23));

            Console.WriteLine(tourBike);

            tourBike = new GoldFrame(tourBike);
            Console.WriteLine(tourBike);

            tourBike = new CustomGrip(tourBike);
            Console.WriteLine(tourBike);
        }
        private static void DecoratorPatternDemo()
        {
            IBicycle myTourBike = new Touring(new NarrowWheel(24));

            Console.WriteLine(myTourBike);

            myTourBike = new CustomGripOption(myTourBike);

            Console.WriteLine(myTourBike);

            myTourBike = new LeatherSeatOption(myTourBike);

            Console.WriteLine(myTourBike);
        }
Exemple #4
0
        private static void DecoratorPatternDemo()
        {
            //Standard Touring Bike
            IBicycle myTourbike = new Touring(new NarrowWheel(24));

            Console.WriteLine(myTourbike);

            // Touring bike with custom grips
            myTourbike = new CustomGripOption(myTourbike);
            Console.WriteLine(myTourbike);

            // Touring bike with leather seat
            myTourbike = new LeatherSeatOption(myTourbike);
            Console.WriteLine(myTourbike);
        }
        //Decorator Design Pattern Method
        private static void DecoratorPatternDemo()
        {
            //Standard Touring Bike taht displays their result to the console
            IBicycle myTourbike = new Touring(new NarrowWheel(24));

            Console.WriteLine(myTourbike);

            //Touring bike with custom grips added to the total price and their result is printed to the console
            myTourbike = new CustomGripOption(myTourbike);
            Console.WriteLine(myTourbike);

            //Touring bike with leather seat added to the existing total and their result is printed to the console
            myTourbike = new LeatherSeatOption(myTourbike);
            Console.WriteLine(myTourbike);
        }
        /* Decorator Design Pattern Method */
        private static void DecoratorPatternDemo()
        {
            //Standard Touring Bike
            IBicycle myTourBike = new Touring(BikeColor.Gold, new NarrowWheel(24));

            Console.WriteLine(myTourBike);

            myTourBike = new CustomGripOption(myTourBike);
            Console.WriteLine(myTourBike);

            myTourBike = new LeatherSeatOption(myTourBike);
            Console.WriteLine(myTourBike);

            myTourBike = new GoldFrameOption(myTourBike);
            Console.WriteLine(myTourBike);
        }
Exemple #7
0
        private static void DecoratorPatternDemo()
        {
            //standrad touring bike
            IBicycle myTourbike = new Touring(new NarrowWheel(24));

            Console.WriteLine(myTourbike);

            //Touring bike with Custom grips
            myTourbike = new CustomGripOption(myTourbike);
            Console.WriteLine(myTourbike);

            //tour bike with leather seat
            myTourbike = new LeatherSheetOption(myTourbike);
            Console.WriteLine(myTourbike);
            //tour bike with whitetire

            myTourbike = new WhiteTireOption(myTourbike);
            Console.WriteLine(myTourbike);
        }