Exemple #1
0
 public Category()
 {
     nameField = String.Empty;
     clueField = new Clue[5];
     for (int i = 0; i < 5; i++)
         clueField[i] = new Clue();
 }
Exemple #2
0
 public void AddClue(Clue c)
 {
     Clue[] clues = new Clue[clueField.Length+1];
     clueField.CopyTo(clues, 0);
     clues[clues.Length-1] = c;
     clueField = clues;
 }
Exemple #3
0
 private void UpdateTreeNode(TreeNode n, Clue c)
 {
     n.Text = c.Question.Replace('\n', ' ').Replace("\r", "") + "\n" + c.Answer;
     n.Tag = c;
     n.ToolTipText = n.Text;
 }
Exemple #4
0
 public void EditClue(Clue c)
 {
     for (int cat = 0; cat < 6; cat++)
     {
         for (int clue = 0; clue < 5; clue++)
         {
             if (QuizShow.Board.Category[cat].Clue[clue] == c)
                 QuizShow.Board.NotifyViews(NotifyAction.ButtonClicked, cat, clue);
         }
     }
 }
Exemple #5
0
        public void Notify(NotifyAction a, int x, int y)
        {
            Board board = QuizShow.Board;

            if (a == NotifyAction.ButtonClicked)
            {
                view.SetSelected(x, y);

                // check if it's the category:
                if (y < 0)
                {
                    EditMode = EditMode.Category;
                    SelectedCategory = board.Category[x];
                    lblWhat.Text = "Category " + (x + 1).ToString();
                    tbAnswer.Focus();
                }
                else
                {
                    EditMode = EditMode.Clue;
                    SelectedClue = board.Category[x].Clue[y];
                    lblWhat.Text = "\"" + board.Category[x].Name + "\" -> $"
                        + board.PointValues[y] + " Clue";
                    tbClue.Focus();
                    tbClue.SelectionStart = tbClue.Text.Length;
                    tbClue.SelectionLength = 0;
                }
            }
            else if (a == NotifyAction.DisplayBoard)
            {
                lblWhat.Text = "Nothing Selected - Click a category or clue to edit";
                EditMode = EditMode.None;
            }
            else if (a == NotifyAction.TrackButtonChanged)
            {
                if (SelectedCategory == null && SelectedClue == null)
                {
                    if (x >= 0)
                    {
                        if (y >= 0)
                        {
                            tbClue.Text = board.Category[x].Clue[y].Question;
                            tbAnswer.Text = board.Category[x].Clue[y].Answer;
                        }
                        else
                        {
                            tbClue.Text = String.Empty;
                            tbAnswer.Text = board.Category[x].Name;
                        }
                    }
                    else
                        tbClue.Text = tbAnswer.Text = String.Empty;
                }
            }
        }