public async Task Run() { topicMet = new TopicMet(fileMaster, userInteractor); topicMet.FindTopics(); while (true) { var key = userInteractor.QuestionAnswerKey("What do you want to do?\n\r" + "If you want to add cards, press 'a'\n\r" + "If you want to learn cards, press 'l'\n\r" + "If you want to exit the application, press 'Esc'"); switch (key) { case UserAction.A: Input input = new Input(fileMaster, userInteractor, topicMet); await input.Run(); break; case UserAction.L: Study study = new Study(fileMaster, userInteractor, topicMet); await study.Run(); break; case UserAction.Escape: userInteractor.WriteLine("bye"); return; default: userInteractor.WriteLine("Write else"); break; } } }
public Input(FileMaster fileMaster, IUserInteractor userInteractor, TopicMet topicMet) { this.fileMaster = fileMaster; this.userInteractor = userInteractor; this.topicMet = topicMet; }