private void update() { score.Text = "Memory Score: " + Math.Round(grade, 2); left++; num.Text = left.ToString() + " / " + copy.getCards().Count().ToString(); correctLbl.Text = ""; card.BackgroundColor = Color.DarkTurquoise; entry.Text = ""; nextBtn.IsVisible = false; fixBtn.IsVisible = false; wrongBtn.IsVisible = false; enterBtn.IsVisible = true; if (set.getCards().Count > 0) { current = set.getCards().First(); string output = ""; foreach (String point in current.getPoints()) { output += point + "\n"; } card.Text = output; if (audioOn == true) { CrossTextToSpeech.Dispose(); var text = card.Text; CrossTextToSpeech.Current.Speak(text); } } }
private void start() { copy.setSet("Memory"); UP = MAX / set.getCards().Count(); DOWN = UP / 5; grade = 0; score = this.FindByName <Label>("title"); num = this.FindByName <Label>("page"); card = this.FindByName <Button>("cardFace"); entry = this.FindByName <Entry>("answer"); enterBtn = this.FindByName <Button>("try"); nextBtn = this.FindByName <Button>("next"); fixBtn = this.FindByName <Button>("fix"); wrongBtn = this.FindByName <Button>("wrong"); correctLbl = this.FindByName <Label>("correct"); recordBtn = this.FindByName <Button>("record"); card.BackgroundColor = Color.DarkTurquoise; //entry.BackgroundColor = Color.White; fixBtn.IsVisible = false; //hide wrongBtn.IsVisible = false; //hide nextBtn.IsVisible = false; //hide left = 1; num.Text = left.ToString() + " / " + copy.getCards().Count().ToString(); current = set.getCards().First(); string output = ""; int i = 0; foreach (String point in current.getPoints()) { i++; output += i.ToString() + ") " + point + "\n"; } card.Text = output; if (audioOn == true) { CrossTextToSpeech.Dispose(); var text = card.Text; CrossTextToSpeech.Current.Speak(text); } }