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(); }
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); }
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(); }