コード例 #1
0
        /// <summary>
        /// Handles the Timer and calls pop-up Message Box
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnTimer(object sender, ElapsedEventArgs e)
        {
            if (!isPaused)
            {
                // Start the timer
                try
                {
                    this.clockTime++;

                    //Pop up
                    if (this.clockTime == this.alarmTime)
                    {
                        // When Timer is done display a pop up baloon message
                        using (ProcessIcon pi = new ProcessIcon())
                        {
                            pi.PopUpBaloon();
                            //Reset the timer so it will call again
                            // WARNING! This will cause it to create a bunch of message boxes if I don't stop it
                            ResetTimer();
                        }
                    }

                }
                catch (Exception ex)
                {
                    MessageBox.Show("OnTimer(): " + ex.Message);
                }
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: cesarrac/stretch-reminder
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Show the System tray icon
            using (ProcessIcon pi = new ProcessIcon())
            {
                pi.Display();

                // Make sure application runs
                Application.Run();

            }
        }