Beispiel #1
0
        //-----------------------------------------------------------------------------------
        #endregion

        #region Menu Item Click Events
        //-------------------------------Menu Item Click Events --------------------------------
        /// <summary>
        /// Creates and opens a new scoresForm object using singleton pattern.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void scoresMItem_Click(object sender, EventArgs e)
        {
            if (scoresForm == null)
            {
                scoresForm         = new ScoresForm();
                scoresForm.Closed += scores_closed;
                scoresForm.Show();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Constructor initializes objects
        /// </summary>
        public GameForm()
        {
            InitializeComponent();

            this.MaximizeBox     = false;
            this.FormBorderStyle = FormBorderStyle.Fixed3D;

            scoresForm     = null;
            bGameIsRunning = false;
            timer          = new Timekeeper();
            //timeThread = new Thread(stopWatch);
        }
Beispiel #3
0
 /// <summary>
 /// Resets the scoresForm object to null, completing singleton.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void scores_closed(object sender, EventArgs e)
 {
     scoresForm = null;
 }