コード例 #1
0
        private void GoToNextFlashcard()
        {
            int currentIndex = CurrentFlashcardIndex;

            if (IsShuffleMode)
            {
                int nextIndex = prRandom.Next(0, IndexOfFirstUnstarredCard);
                if (currentIndex != nextIndex)
                {
                    CurrentFlashcardIndex = nextIndex;
                }
                else if (nextIndex > 0)
                {
                    CurrentFlashcardIndex = nextIndex - 1;
                }
                else
                {
                    CurrentFlashcardIndex = IndexOfFirstUnstarredCard - 1;
                }
            }
            else
            {
                CurrentFlashcardIndex = (currentIndex + 1) % IndexOfFirstUnstarredCard;
            }
            IsShowingTerm = true;
            PreviousFlashcardIndexes.Push(currentIndex);
            OnPropertyChanged("CurrentFlashcardIndex");
            OnPropertyChanged("CurrentFlashcard");
            OnPropertyChanged("HasPreviousFlashcards");
            OnPropertyChanged("CurrentSideShowing");
        }
コード例 #2
0
 private void GoToPreviousFlashcard()
 {
     if (PreviousFlashcardIndexes.Count > 0)
     {
         CurrentFlashcardIndex = PreviousFlashcardIndexes.Pop();
     }
     IsShowingTerm = true;
     OnPropertyChanged("CurrentFlashcardIndex");
     OnPropertyChanged("CurrentFlashcard");
     OnPropertyChanged("HasPreviousFlashcards");
     OnPropertyChanged("CurrentSideShowing");
 }