示例#1
0
        public void Run()
        {
            bool running = true;

            while (running)
            {
                DisplayMenu();
                Write("Wybierz opcję: ");

                switch (Console.ReadLine())
                {
                case "1":
                {
                    Write();
                    Comment($"zanotowano: {_notebook.CountEntries()}");
                    foreach (INotebookEntry item in _notebook.GetAll())
                    {
                        Write(item.GetSlug());
                    }
                    break;
                }

                case "2":
                {
                    Write("Podaj tytuł filmu: ");
                    string       title = Console.ReadLine();
                    WatchedMovie movie = new WatchedMovie(title);
                    _notebook.Save(movie);
                    break;
                }

                case "3":
                {
                    Write("Podaj nazwę piwa: ");
                    string name = Console.ReadLine();
                    Write("Podaj nazwę browaru: ");
                    string    brewery = Console.ReadLine();
                    DrankBeer beer    = new(name, brewery);
                    _notebook.Save(beer);
                    break;
                }

                case "x":
                {
                    running = false;
                    break;
                }

                default:
                {
                    break;
                }
                }
            }
        }