示例#1
0
        private async Task FindData()
        {
            if (topicMet.FindOrCreateTopic())
            {
                var key = userInteractor.QuestionAnswerKey("If you want to watch your cards, press 'Enter', if not - press else");
                if (key == UserAction.Enter)
                {
                    var flashcards = await fileMaster.ReadData(topicMet.PathTopic);

                    if (flashcards == null)
                    {
                        userInteractor.WriteLine("Don't have cards");
                    }
                    else
                    {
                        foreach (var flashcard in flashcards)
                        {
                            userInteractor.WriteLine($"{flashcard.Topic} - " +
                                                     $"{flashcard.FrontOrForeignTranslation} - " +
                                                     $"{flashcard.Transcription} - " +
                                                     $"{flashcard.BackOrOriginalWord}");
                        }
                    }
                }
            }
            await EnterData();
        }
示例#2
0
 private async Task <List <Flashcard> > TakeFlashCards(string path)
 {
     return(await fileMaster.ReadData(path));
 }