/// <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)); }
/// <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(); } }
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(); }
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 + ")"); }; }
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(); } }
public static void LaunchProjectFormIn(string interval) { int inter = HTime.inMilliseconds(interval); LaunchProjectFormIn(inter); }