示例#1
0
        /// <summary>
        /// Called when Configuration is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void configurationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.Visible)
            {
                FormForcefullyHidden = true;
            }

            HideAlert();

            //if FormSubmit is shown dispose of it.
            if (FormSubmit != null)
            {
                FormSubmit.Dispose();
                FormSubmit = null;
            }

            //If configuration form is already open place it on top again.
            if (FormConfiguration != null)
            {
                FormConfiguration.AnchorForm();
                FormConfiguration.SendToTop();
                FormConfiguration.Show();
            }
            //If configuration form isn't open make a new one and show it.
            else
            {
                FormConfiguration = new FormConfiguration();
                FormConfiguration.Initialize(this);
                FormConfiguration.Show();
            }
        }
示例#2
0
 /// <summary>
 /// Called by FormSubmit when being closed, after a send or cancel.
 /// </summary>
 public void FormSubmitClosed()
 {
     FormSubmit = null;
     //If form was forcefully hidden then reveal it again.
     if (FormForcefullyHidden)
     {
         FormForcefullyHidden = false;
         ShowAlert();
     }
 }
示例#3
0
        /// <summary>
        /// Called when system tray icon is clicked.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NotificationIcon_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                //Only allow this action if application is configured.
                if (ConfigurationIncomplete())
                {
                    return;
                }

                //if FormConfiguration is shown dispose of it.
                if (FormConfiguration != null)
                {
                    FormConfiguration.Dispose();
                    FormConfiguration = null;
                }

                if (this.Visible)
                {
                    FormForcefullyHidden = true;
                }

                HideAlert();
                //If send/submit message form is already open place it on top again.
                if (FormSubmit != null)
                {
                    FormSubmit.AnchorForm();
                    FormSubmit.SendToTop();
                    FormSubmit.Show();
                }
                //If send/submit message form isn't open make a new one and show it.
                else
                {
                    FormSubmit = new FormSubmit();
                    FormSubmit.Initialize(this);
                    FormSubmit.Show();
                }
            }
            //else if (e.Button == MouseButtons.Right)
            //    Debug.Print("Right clicked");
        }