コード例 #1
0
        /// <summary>
        /// Handles the Click event of the Pause And Remind control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void PauseAndRemindIn_Click(object sender, EventArgs e)
        {
            TimerFile.Instance.addEndItem();
            string newInterval = ((ToolStripMenuItem)sender).Text;

            Program.LaunchProjectFormIn(HTime.inMilliseconds(newInterval));
        }
コード例 #2
0
 /// <summary>
 /// Handles the Enter key event for the textbox of a new time interval for manual reminder
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void NewInterval_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TimerFile.Instance.addEndItem();
         string newInterval = ((ToolStripTextBox)sender).Text;
         Program.LaunchProjectFormIn(HTime.inMilliseconds(newInterval));
         ((ContextMenuStrip)((ToolStripDropDownMenu)(((ToolStripTextBox)sender).Owner)).OwnerItem.Owner).Close();
     }
 }
コード例 #3
0
        private void remindLater_button_Click(object sender, EventArgs e)
        {
            // TODO: a better interval parser than <int><space><unit>
            int interval = 0;
            string laterText = later_comboBox.Text.Trim();

            interval = HTime.inMilliseconds(laterText, Ini.GetString("Values", "DefaultReminderUnit", "seconds"));

            Program.LaunchProjectFormIn(interval);
            this.Close();
        }
コード例 #4
0
        public static void LaunchReminder(string interval, string text)
        {
            int   inter         = HTime.inMilliseconds(interval);
            Timer reminderTimer = new Timer();

            reminderTimer.Interval = inter;
            reminderTimer.Start();

            reminderTimer.Tick += (sender, eventArgs) =>
            {
                reminderTimer.Stop();
                MessageBox.Show(text, "Reminder (" + interval + ")");
            };
        }
コード例 #5
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Debug.WriteLineIf(iniFile == null || iniFile == "", "Ini file was not well defined.");
            Ini.SetFile(iniFile);

            // Show the system tray icon.
            using (ProcessIcon pi = new ProcessIcon())
            {
                checkFiles();

                pi.Display();
                string remindIn = Ini.GetString("StartupReminder", "Interval", "5 mins");
                LaunchProjectFormIn(HTime.inMilliseconds(remindIn));

                AutoSave.Start();

                // Make sure the application runs!
                Debug.WriteLine("Start application.");
                Application.Run();
            }
        }
コード例 #6
0
        public static void LaunchProjectFormIn(string interval)
        {
            int inter = HTime.inMilliseconds(interval);

            LaunchProjectFormIn(inter);
        }