Пример #1
0
        public Bouquet Menu()
        {
            Console.Clear();
            OutputMenu();
            Bouquet newBouquet = null;

            char mode = ' ';

            do
            {
                mode = Program.EnterMode();
                switch (mode)
                {
                case 'o':
                    OutputMenu();
                    break;

                case 'w':
                    newBouquet = Source.ConstructWeddingBouquet();
                    break;

                case 'a':
                    newBouquet = Source.ConstructАnniversaryBouquet();
                    break;

                case 'c':
                    newBouquet = Source.ConstructCustomBouquet();
                    break;

                case 'q':
                    break;

                default:
                    Console.WriteLine(" < Wrong mode > ");
                    break;
                }
            } while (mode != 'q' && newBouquet == null);
            Console.Clear();
            return(newBouquet);
        }
Пример #2
0
 public SignedBouquet(Bouquet bouquet, Postcard postcard) : base(bouquet)
 {
     mainConstructor(postcard);
 }
Пример #3
0
        public static void Menu()
        {
            MainMenu();
            char mode = ' ';

            Bouquet    currentBuquet = null;
            FlowerShop shop          = FlowerShop.GetSource();

            do
            {
                mode = Program.EnterMode();
                switch (mode)
                {
                case 'o':
                    MainMenu();
                    break;

                case 'c':
                    shop.SetBuilder(new CascadeBouquetBuilder());
                    currentBuquet = shop.Menu();
                    MainMenu();
                    break;

                case 'r':
                    shop.SetBuilder(new RoundBouquetBuilder());
                    currentBuquet = shop.Menu();
                    MainMenu();
                    break;

                case 't':
                    shop.SetBuilder(new TriangularBouquetBuilder());
                    currentBuquet = shop.Menu();
                    MainMenu();
                    break;

                case 'i':
                    if (currentBuquet != null)
                    {
                        currentBuquet.GetInfo();
                    }
                    else
                    {
                        Console.WriteLine(" < Bouquet wasn't constructed > ");
                    }
                    break;

                case 'w':
                    if (currentBuquet != null)
                    {
                        BouquetWrapper wrapper = new BouquetWrapper();
                        wrapper.ChooseWrapper();
                        MainMenu();
                        currentBuquet = new WrappedBouquet(currentBuquet, wrapper);
                    }
                    else
                    {
                        Console.WriteLine(" < Bouquet wasn't constructed > ");
                    }
                    break;

                case 'p':
                    if (currentBuquet != null)
                    {
                        Postcard postcard = new Postcard();
                        postcard.SignPostcard();
                        currentBuquet = new SignedBouquet(currentBuquet, postcard);
                    }
                    else
                    {
                        Console.WriteLine(" < Bouquet wasn't constructed > ");
                    }
                    break;

                case 'q':
                    break;

                default:
                    Console.WriteLine(" < Wrong mode > ");
                    break;
                }
            } while (mode != 'q');
        }
Пример #4
0
 protected Bouquet(Bouquet bouquet)
 {
 }
Пример #5
0
 public BouquetDecorator(Bouquet bouquet) : base(bouquet)
 {
     Wrapper      = null;
     Postcard     = null;
     this.bouquet = bouquet;
 }
Пример #6
0
 public WrappedBouquet(Bouquet bouquet, BouquetWrapper wrapper) : base(bouquet)
 {
     mainConstructor(wrapper);
 }