private async void ButtonForAdding_Clicked(object sender, EventArgs e) { if (NativeWord.Text == null || ForeignWord == null) { await DisplayAlert(null, "Упс... Вы ничего не ввели", "Исправить!"); } flashCard.Add(NativeWord.Text, ForeignWord.Text); NativeWord.Text = null; ForeignWord.Text = null; }
public void Testing(string line) { index++; if (index >= flash_card.Count) { flash_card = flash_card - incorrect_flash_card; return; } if ((string)flash_card[NativeWord.Text] == line) { NativeWord.Text = (string)flash_card[index]; ForeignWord.Text = "\0"; } else { number_of_incorrect_cards++; incorrect_flash_card.Add(NativeWord.Text, (string)flash_card[NativeWord.Text]); NativeWord.Text = (string)flash_card[index]; ForeignWord.Text = "\0"; } return; }
FlashCard GettingTheCollection(string line, FlashCard card) { string key = null; string value = null; bool flag = false; //flag of ' ' foreach (char sign in line) { if (sign == '\n') { flag = false; card.Add(key, value); key = null; value = null; continue; } if (sign == ' ') { flag = true; continue; } if (!flag) { key += sign; } if (flag) { value += sign; } } return(card); }