Beispiel #1
0
        public GameWin()
        {
            Text = "Quiz Show Presenter : Game View";
            ClientSize = new Size(1024, 768);

            view = new GameBoardView();
            view.Dock = DockStyle.Fill;
            Controls.Add(view);
        }
Beispiel #2
0
        public GameBoardButton(GameBoardView view)
        {
            this.view = view;

            hiliteBrush = new SolidBrush(Color.FromArgb(192, 192, 255));
            shadowBrush = new SolidBrush(Color.FromArgb(0, 0, 128));
            selectBrush = new SolidBrush(Color.FromArgb(192, 0, 255));
            focusBrush = new SolidBrush(Color.FromArgb(255, 0, 0));
        }
Beispiel #3
0
        public PresenterWin()
        {
            Text = "Quiz Show Presenter : Manager View";
            ClientSize = new Size(1024, 768);

            view = new GameBoardView();
            view.Location = new Point(0, 0);
            Controls.Add(view);

            lblAnswer = new Label();
            lblAnswer.ForeColor = Color.White;
            lblAnswer.TextAlign = ContentAlignment.TopCenter;
            lblAnswer.Visible = false;
            lblAnswer.UseMnemonic = false;
            Controls.Add(lblAnswer);

            QuizShow.Board.AddView(this);
            OnSizeChanged(EventArgs.Empty);
        }
Beispiel #4
0
        private bool DoLoad(string filename)
        {
            if (filename == null)
                QuizShow.Board = new Board();
            else
            {
                try
                {
                    using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read))
                    {
                        XmlSerializer xs = new XmlSerializer(typeof(Board));
                        QuizShow.Board = (Board)xs.Deserialize(fs);
                    }
                }
                catch (InvalidOperationException e)
                {
                    MessageBox.Show(this, "The document you selected is not a valid board\n\n" +
                        "Reason: " + e.Message,
                        Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return false;
                }
            }

            QuizShow.Board.AddView(this);

            view = new GameBoardView();
            view.Editable = true;
            view.Dock = DockStyle.Fill;
            viewSplit.Panel1.Controls.Add(view);

            if (filename != null)
                mruFiles.AddFile(filename);

            CurrentFileName = filename;
            IsDirty = false;
            UpdateUI();
            UpdateTree();
            UpdateMRUMenu();

            return true;
        }
Beispiel #5
0
        private bool DoClose()
        {
            if (QuizShow.Board == null)
                return true;

            if (IsDirty)
            {
                DialogResult dr = MessageBox.Show(this, "Do you want to save changes to " + CurrentDocName + " before closing?",
                    Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                if (dr == DialogResult.Cancel)
                    return false;
                else if (dr == DialogResult.Yes)
                {
                    if (!DoSave(false))
                        return false;
                }
            }

            view.Dispose();
            view = null;
            QuizShow.Board = null;

            CurrentFileName = null;
            IsDirty = false;
            UpdateUI();
            UpdateTree();

            return true;
        }