Esempio n. 1
0
        public AnswerSet Prev()
        {
            //selectedIndex is not allowed an invalid value
            if (this.selectedAnswerIndex == 0)
            {
                return(null);
            }

            this.selectedAnswerIndex--;
            SelectedAnswerChanged?.Invoke(this, EventArgs.Empty);
            return(this.answers[this.selectedAnswerIndex]);
        }
Esempio n. 2
0
        public AnswerSet Next()
        {
            //selectedIndex is not allowed an invalid value
            if (this.selectedAnswerIndex == this.answers.Count - 1)
            {
                if (Current.isEmpty())
                {
                    return(Current);
                }
                else
                {
                    this.answers.Add(new AnswerSet(this.answerCount));
                    //Proceed normally
                }
            }

            this.selectedAnswerIndex++;
            SelectedAnswerChanged?.Invoke(this, EventArgs.Empty);
            return(this.answers[this.selectedAnswerIndex]);
        }