public async Task GetNewQuestion()
        {
            var questions = await _questions.GetWhiteboardQs();

            Random rand = new Random();
            int    num  = rand.Next(questions.Count);
            int    i    = 0;

            while (NumbersUsed.Contains(num))
            {
                i++;
                if (i == questions.Count)
                {
                    NumbersUsed = new List <int>();
                }
                num = rand.Next(questions.Count);
            }
            NumbersUsed.Add(num);
            Question = new WhiteboardViewModel()
            {
                Question = questions[num].Question
            };
        }
Esempio n. 2
0
 public void SetWhiteboard(WhiteboardViewModel wb)
 {
     _whiteboard = wb;
     _whiteboard.SelectionChanged += _whiteboard_SelectionChanged;
 }