Пример #1
0
        /// <summary>
        /// Displays a TotalsForm if buttonTotals clicked
        /// </summary>
        /// <param name="sender">the control/object to set</param>
        /// <param name="e">the event data to set</param>
        private void buttonTotals_Click(object sender, EventArgs e)
        {
            TotalsDialog dlg = TotalsDialog.CreateForm();

            dlg.Show();
            dlg.Activate();
        }
Пример #2
0
        /// <summary>
        /// Method to create a TotalsDialog Form
        /// </summary>
        /// <returns>instance</returns>
        public static TotalsDialog CreateForm()   // create public static method with form type return
        {
            if (instance == null)
            {
                instance = new TotalsDialog();
            }

            return(instance);
        }
Пример #3
0
 /// <summary>
 /// Method to make instance of form to null upon closing
 /// </summary>
 /// <param name="sender">the control/object to set</param>
 /// <param name="e">the event data to set</param>
 private void TotalsDialog_FormClosing(object sender, FormClosingEventArgs e)
 {
     instance = null;
 }