Exemplo n.º 1
0
 public MenuNavigation(IInputValidation inputValidation, IMenuFormatting menuFormatting, IList <IMovie> movies, IRelevantMenus relevantMenus)
 {
     _inputValidation           = inputValidation;
     _menuFormatting            = menuFormatting;
     _movies                    = movies;
     _relevantMenus             = relevantMenus;
     _relevantMenus.CurrentMenu = MenuTypeCodes.MAIN_MENU;
     _menuCommands              = new MenuCommands(_menuFormatting, new AddNewMovie(), new DeleteMovie(), new SearchForMovies(), _inputValidation, _movies, _relevantMenus);
     _menuCommands.PrintCurrentMenu();
     HandleMenuSelection();
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            _movies = new List <IMovie>();
            _movies = GetMoviesFromTextFile.GetMovies();

            _inputValidation = new InputValidation();
            _searchForMovies = new SearchForMovies();
            _menuFormatting  = new MenuFormatting();
            _relevantMenus   = new RelevantMenus();

            var menuNavigation = new MenuNavigation(_inputValidation, _menuFormatting, _movies, _relevantMenus);
        }
Exemplo n.º 3
0
 public MenuCommands(IMenuFormatting menuFormatting, IAddNewMovie addNewMovie, IDeleteMovie deleteMovie, ISearchForMovies searchForMovies, IInputValidation inputValidation, IList <IMovie> movies, IRelevantMenus relevantMenus)
 {
     _menuFormatting       = menuFormatting;
     _addNewMovie          = addNewMovie;
     _deleteMovie          = deleteMovie;
     _searchForMovies      = searchForMovies;
     _inputValidation      = inputValidation;
     _movies               = movies;
     _relevantMenus        = relevantMenus;
     _menusToPrint         = new Dictionary <string, Action>();
     _searchedMovieResults = new List <IMovie>();
     SetUpDelegates();
     GenerateMenusToPrint();
 }