private void btnImport_Click(object sender, EventArgs e) { try { if (lvReminders.CheckedItems.Count > 0) { foreach (Reminder rem in GetSelectedRemindersFromListview()) { if (!File.Exists(rem.SoundFilePath)) //when you import reminders on another device, the path to the file might not exist. remove it. { rem.SoundFilePath = ""; } BLIO.Log("Pushing reminder with id " + rem.Id + " To the database"); BLReminder.PushReminderToDatabase(rem); } //Let remindme know that the listview should be refreshed BLIO.Log("Sending message WM_RELOAD_REMINDERS ...."); PostMessage((IntPtr)HWND_BROADCAST, WM_RELOAD_REMINDERS, new IntPtr(0xCDCD), new IntPtr(0xEFEF)); this.Close(); } else { RemindMeMessageFormManager.MakeMessagePopup("Please select at least one reminder.", 3); } } catch (Exception ex) { ErrorPopup pop = new ErrorPopup("Error inserting reminders", ex); pop.Show(); BLIO.WriteError(ex, "Error inserting reminders"); } }
private void Cleanup() { try { BLIO.Log("Starting Cleanup..."); //RemindMe loaded, if an old system log/temp reminders still exists, delete it string oldSystemLog = IOVariables.systemLog; string oldTempReminders = System.IO.Path.GetTempPath() + "Exported Reminders.remindme"; string oldUpdateFilesZip = IOVariables.rootFolder + "UpdateFiles.zip"; if (System.IO.File.Exists(oldSystemLog)) { System.IO.File.Delete(oldSystemLog); BLIO.Log("- Deleted " + Path.GetFileName(oldSystemLog)); } if (System.IO.File.Exists(oldTempReminders)) { System.IO.File.Delete(oldTempReminders); BLIO.Log("- Deleted " + Path.GetFileName(oldTempReminders)); } if (System.IO.File.Exists(oldUpdateFilesZip)) { System.IO.File.Delete(oldUpdateFilesZip); BLIO.Log("- Deleted " + Path.GetFileName(oldUpdateFilesZip)); } if (Directory.Exists(IOVariables.applicationFilesFolder + "\\old")) { Directory.Delete(IOVariables.applicationFilesFolder + "\\old", true); BLIO.Log("- Deleted \\old Folder"); } //If the errorlog is >= 5mb , clear it. That's a bit big.. if (System.IO.File.Exists(IOVariables.errorLog) && new FileInfo(IOVariables.errorLog).Length / 1024 >= 5000) { BLIO.Log("Clearing error log that is too large... [" + new FileInfo(IOVariables.errorLog).Length / 1024 + ".mb ]"); if (System.IO.File.Exists(IOVariables.errorLog)) { System.IO.File.WriteAllText(IOVariables.errorLog, ""); } } BLIO.Log("Cleanup complete."); } catch (UnauthorizedAccessException ex) { BLIO.Log("Cleanup() FAILED. Unauthorized"); //BLIO.WriteError(ex, "Error in Cleanup()"); //don't write this one to the db } catch (IOException ex) { BLIO.Log("Cleanup() FAILED. IOException"); BLIO.WriteError(ex, "Error in Cleanup()"); } catch (Exception ex) { BLIO.Log("Cleanup() FAILED. Global exception"); BLIO.WriteError(ex, "Error in Cleanup()"); } }
private void MaterialForm1_FormClosing(object sender, FormClosingEventArgs e) { if (!shouldClose) { BLIO.Log("lblExit_Click (X) (kinda)"); this.Opacity = 0; this.Hide(); e.Cancel = true; return; } BLIO.Log("MaterialForm1_FormClosing [" + e.CloseReason + "]"); BLIO.DumpLogTxt(); if (MUCTimer.RunningTimers.Count > 0) { if (MaterialRemindMeBox.Show("You have (" + MUCTimer.RunningTimers.Count + ") active timers running.\r\n\r\nAre you sure you wish to close RemindMe? These timers will not be saved\r\n\r\nClick here to convert these Timers into Reminders and close RemindMe", RemindMeBoxReason.YesNo, false, FormStartPosition.CenterScreen) == DialogResult.No) { e.Cancel = true; shouldClose = false; return; } } //Makes the mouseclick a little bit less laggy new Thread(() => { Environment.Exit(0); }).Start(); }
private void UCResizePopup_VisibleChanged(object sender, EventArgs e) { if (this.Visible) { BLIO.Log("Control UCResizePopup now visible"); } }
private void btnOk_Click(object sender, EventArgs e) { try { BLIO.Log("btnOk pressed on ExceptionPopup. textbox text = " + tbFeedback.Text); string logTxtPath = IOVariables.systemLog; string textBoxText = tbFeedback.Text; //Cant access tbNote in a thread. save the text in a variable instead if (string.IsNullOrWhiteSpace(textBoxText) || tbFeedback.ForeColor == Color.Gray) { textBoxText = null; } BLOnlineDatabase.AddException(exception, DateTime.UtcNow, logTxtPath, textBoxText); if (textBoxText != null && tbFeedback.ForeColor != Color.Gray) { RemindMeMessageFormManager.MakeMessagePopup("Feedback sent.\r\nThank you for taking the time!", 5); } //Set this boolean to true so that when this popup closes, we won't try to add another db entry customFeedback = true; btnOk.Enabled = false; this.Close(); this.Dispose(); } catch { } }
private void numericUpDown_ValueChange(object sender, EventArgs e) { if (currentTimerItem == null) { return; } try { int secondsRemaining = Convert.ToInt32((Convert.ToInt32(numHours.Text) * 60 * 60) + (Convert.ToInt32(numMinutes.Text) * 60) + Convert.ToInt32(numSeconds.Text)); if (secondsRemaining < -5) { BLIO.Log("Woah there.. Let's not assign this new time to this timer ;)"); numHours.Text = numHours.Text.Substring(0, numHours.Text.Length - 2); return; } currentTimerItem.SecondsRemaining = secondsRemaining; } catch (OverflowException ex) { BLIO.Log("That number is a bit too large for this timer ;)"); numHours.Text = numHours.Text.Substring(0, numHours.Text.Length - 2); numericUpDown_ValueChange(null, null); } catch (Exception ex) { BLIO.Log("numericUpDown_valuechange collection FAILED. -> " + ex); BLIO.WriteError(ex, "Failed to add time to this timer"); } }
private void btnAddReminder_Click(object sender, EventArgs e) { BLIO.Log("(UCResizePopup)btnAddReminder_Click"); if (testPop == null || testPop.IsDisposed) { testPop = new Popup(testrem); //create a new instance testPop.MaximumSize = new Size(int.MaxValue, int.MaxValue); testPop.Width = (int)trbWidth.Value; testPop.Height = (int)trbHeight.Value; testPop.lblNoteText2.Font = new Font(testPop.lblNoteText2.Font.FontFamily, (float)trbNoteFont.Value, FontStyle.Bold); testPop.lblTitle.Font = new Font(testPop.lblTitle.Font.FontFamily, (float)trbTitleFont.Value, FontStyle.Bold); testPop.Show(); //show the new instance. } if (!testPop.Visible) { testPop.Show(); testPop.Visible = true; } else { ApplyPreviewChanges(); } }
public static DialogResult Show(string text, string title, RemindMeBoxReason buttons, bool showDontRemindOption = false) { newMessageBox = new RemindMeBox(text, title, buttons, showDontRemindOption); newMessageBox.ShowDialog(); BLIO.Log("Closing RemindMeBox with result " + result); return(result); }
public Popup(Reminder rem) { BLIO.Log("Constructing Popup reminderId = " + rem.Id); InitializeComponent(); this.Opacity = 0; this.rem = rem; this.Size = new Size((int)BLPopupDimensions.GetPopupDimensions().FormWidth, (int)BLPopupDimensions.GetPopupDimensions().FormHeight); lblTitle.Font = new Font(lblTitle.Font.FontFamily, BLPopupDimensions.GetPopupDimensions().FontTitleSize, FontStyle.Bold); lblNoteText.Font = new Font(lblNoteText.Font.FontFamily, BLPopupDimensions.GetPopupDimensions().FontNoteSize, FontStyle.Bold); this.Text = rem.Name; lblNoteText.MaximumSize = new Size((pnlText.Width - lblNoteText.Location.X) - 10, 0); lblTitle.MaximumSize = new Size((pnlTitle.Width - lblTitle.Location.X) - 10, 0); //Assign the events that the user can raise while doing something on the popup. The stopflash event stops the taskbar icon from flashing lblTitle.MouseClick += stopFlash_Event; lblNoteText.MouseClick += stopFlash_Event; this.MouseClick += stopFlash_Event; this.ResizeEnd += stopFlash_Event; BLIO.Log("Popup constructed"); //Don't show postpone options if the reminder isn't real if (rem.Id == -1) { cbPostpone.Visible = false; lblPostpone.Visible = false; tbPostpone.Visible = false; } }
private void MUCReminders_VisibleChanged(object sender, EventArgs e) { if (this.Visible) { BLIO.Log("Control MUCReminders now visible"); } }
private void bunifuFlatButton1_Click(object sender, EventArgs e) { BLIO.Log("(UCSupport)bunifuFlatButton1_Click [btnView]"); if (lvMessages.SelectedItems.Count > 0) { ListViewItem itm = lvMessages.SelectedItems[0]; RemindMeMessages mess = BLOnlineDatabase.GetRemindMeMessageById(Convert.ToInt32(itm.Tag)); if (mess == null) { RemindMeMessageFormManager.MakeMessagePopup("Could not show this message. It does not exist anymore", 4); lvMessages.Items.Remove(itm); BLLocalDatabase.ReadMessage.DeleteMessage(Convert.ToInt32(itm.Tag)); return; //Doesn't exist in the database anymore } if (mess.NotificationType == "REMINDMEBOX") { BLIO.Log("Attempting to show the user a RemindMe message(REMINDMEBOX)..."); RemindMeBox.Show("A Message from the creator of RemindMe", mess.Message.Replace("¤", Environment.NewLine), RemindMeBoxReason.OK); } else if (mess.NotificationType == "REMINDMEMESSAGEFORM") { BLIO.Log("Attempting to show the user a RemindMe message(REMINDMEMESSAGEFORM)..."); RemindMeMessageFormManager.MakeMessagePopup(mess.Message.Replace("¤", Environment.NewLine), mess.NotificationDuration.Value); } else { BLIO.Log("Attempting to show the user a RemindMe message FAILED. Notificationtype=" + mess.NotificationType + " Message=" + mess.Message + " Id=" + mess.Id); RemindMeMessageFormManager.MakeMessagePopup("Could not preview this message. Unknown notification type", 4); lvMessages.Items.Remove(itm); BLLocalDatabase.ReadMessage.DeleteMessage(mess.Id); } } }
private void MUCReminders_DragDrop(object sender, DragEventArgs e) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); BLIO.Log(files.Length + " File(s) dropped into RemindMe!"); BLIO.Log(".remindme files: " + files.Where(file => Path.GetExtension(file) == ".remindme").ToList().Count); //Loop through each file that is dragged into RemindMe foreach (string file in files.Where(file => Path.GetExtension(file) == ".remindme").ToList()) { List <object> remindersFromFile = BLReminder.DeserializeRemindersFromFile(file); //Objects from the .remindme file foreach (object rem in remindersFromFile.Where(rem => rem.GetType() == typeof(Reminder)).ToList()) { BLReminder.PushReminderToDatabase((Reminder)rem); BLIO.Log("Deserialized reminder and inserted it into RemindMe"); } } new Thread(() => { //Log an entry to the database, for data! try { BLOnlineDatabase.ImportCount++; } catch (ArgumentException ex) { BLIO.Log("Exception at BLOnlineDatabase.ImportCount++ MUCReminders.cs . -> " + ex.Message); BLIO.WriteError(ex, ex.Message, true); } }).Start(); //finally, refresh the listview UpdateCurrentPage(); }
public ErrorPopup(string message, Exception ex) { BLIO.Log("Constructing ErrorPopup (" + ex.GetType().ToString() + ")"); InitializeComponent(); lblText.MaximumSize = new Size((pnlMainGradient.Width - lblText.Location.X) - 10, 0); lblTitle.MaximumSize = new Size((pnlMainGradient.Width - lblTitle.Location.X) - 10, 0); //Set the location within the remindme window. //This prompt can be moved, but inititally will be set to the middle of the location of RemindMe Form1 remindme = (Form1)Application.OpenForms["Form1"]; if (remindme != null) { this.StartPosition = FormStartPosition.Manual; this.Location = new Point(remindme.Location.X + ((remindme.Width / 2) - this.Width / 2), remindme.Location.Y + ((remindme.Height / 2) - (this.Height / 2))); } this.ex = ex; this.message = message; lblText.Text = message + "\r\nCould you report how this happened?"; while (pnlMainGradient.Height < (lblText.Location.Y + lblText.Height)) { this.Height += 35; } BLIO.Log("Constructing ErrorPopup complete"); }
private void btnOpenErrorPrompt_Click(object sender, EventArgs e) { BLIO.Log("btnOpenErrorPrompt_Click"); ExceptionPopup pop = new ExceptionPopup(new ReminderException("Test", null), "This is a test error in debug mode"); pop.Show(); }
private void btnConfirm_Click(object sender, EventArgs e) { BLIO.Log("Confirm button pressed (UCImportExport)"); bool success = false; switch (transferType) { case ReminderTransferType.IMPORT: BLIO.Log("Importing reminders ... (UCImportExport)"); success = ImportReminders(); break; case ReminderTransferType.EXPORT: BLIO.Log("Exporting reminders ... (UCImportExport)"); success = Exportreminders(); break; case ReminderTransferType.RECOVER: BLIO.Log("Recovering reminders ... (UCImportExport)"); success = RecoverReminders(); break; } if (success) { foreach (ListViewItem item in lvReminders.CheckedItems) { lvReminders.Items.Remove(item); } } ToggleButton(null); UCReminders.Instance.UpdateCurrentPage(); }
private void btnSettings_Click(object sender, EventArgs e) { BLIO.Log("Settings button clicked on reminder item (" + rem.Id + ")"); HideOrShowRemovePostponeMenuItem(rem); HideOrShowSkipForwardMenuItem(rem); ReminderMenuStrip.Show(Cursor.Position); }
private void UCImportExport_VisibleChanged(object sender, EventArgs e) { if (this.Visible) { BLIO.Log("Control UCImportExport now visible"); } }
private void btnDelete_Click(object sender, EventArgs e) { BLIO.Log("Delete button clicked on reminder item (" + rem.Id + ")"); BLReminder.DeleteReminder(rem); this.Reminder = null; UCReminders.Instance.UpdateCurrentPage(); }
private void btnNewTimer_Click(object sender, EventArgs e) { BLIO.Log("btnNewTimer clicked!"); MaterialTimerPopup quickTimer = new MaterialTimerPopup(); quickTimer.Show(); }
private void skipToNextDateToolStripMenuItem_Click(object sender, EventArgs e) { BLIO.Log("Toolstrip option clicked: Skip (" + rem.Id + ")"); //The reminder object has now been altered. The first date has been removed and has been "skipped" to it's next date BLReminder.SkipToNextReminderDate(rem); //push the altered reminder to the database BLReminder.EditReminder(rem); //Refresh to show changes UCReminders.Instance.UpdateCurrentPage(); new Thread(() => { //Log an entry to the database, for data! try { BLOnlineDatabase.SkipCount++; } catch (ArgumentException ex) { BLIO.Log("Exception at BLOnlineDatabase.SkipCount++. -> " + ex.Message); BLIO.WriteError(ex, ex.Message, true); } }).Start(); }
private void tbNoteFont_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { BLIO.Log("tbNoteFont_KeyUp (Enter) with value: " + tbNoteFont.Text); int size = 0; bool success = int.TryParse(tbNoteFont.Text, out size); if (success) { if (size > trbNoteFont.Maximum) { size = trbNoteFont.Maximum; } if (size < trbNoteFont.Minimum) { size = trbNoteFont.Minimum; } tbNoteFont.Text = size.ToString(); trbNoteFont.Value = size; ApplyPreviewChanges(); } } }
private void toolStripMenuItem1_Click(object sender, EventArgs e) { BLIO.Log("Toolstrip option clicked: Permanentely delete (" + rem.Id + ")"); if (RemindMeBox.Show("Are you really sure you wish to permanentely delete \"" + rem.Name + "\" ?", RemindMeBoxReason.YesNo) == DialogResult.Yes) { BLIO.Log("Permanentely deleting reminder with id " + rem.Id + " ..."); BLReminder.PermanentelyDeleteReminder(rem); BLIO.Log("Reminder permanentely deleted."); this.Reminder = null; UCReminders.Instance.UpdateCurrentPage(); new Thread(() => { //Log an entry to the database, for data! try { BLOnlineDatabase.PermanentelyDeleteCount++; } catch (ArgumentException ex) { BLIO.Log("Exception at BLOnlineDatabase.PermanentelyDeleteCount++. -> " + ex.Message); BLIO.WriteError(ex, ex.Message, true); } }).Start(); } else { BLIO.Log("Permanent deletion of reminder " + rem.Id + " cancelled."); } }
private void tbCheckTimerHotKey_KeyUp(object sender, KeyEventArgs e) { if (!e.Shift && !e.Control && !e.Alt) //None of the key key's (get it?) pressed? return. return; //Good! now let's check if the KeyCode is not alt shift or ctr if (e.KeyCode == Keys.Alt || e.KeyCode == Keys.ControlKey || e.KeyCode == Keys.ShiftKey) return; BLIO.Log("tbCheckTimerHotKey legal key combination pressed."); tbCheckTimerHotKey.Text = ""; foreach (string m in e.Modifiers.ToString().Split(',')) { tbCheckTimerHotKey.Text += m + " + "; } tbCheckTimerHotKey.Text += e.KeyCode.ToString(); BLIO.Log("tbCheckTimerHotKey key combination: " + tbCheckTimerHotKey.Text); //Get the current key combination for the Timer popup Hotkeys timerCheckKey = BLLocalDatabase.Hotkey.TimerCheck; timerCheckKey.Key = e.KeyCode.ToString(); //Set the new key timerCheckKey.Modifiers = e.Modifiers.ToString().Replace(" ", string.Empty); //Set the new modifier(remove whitespace) BLLocalDatabase.Hotkey.TimerCheck = timerCheckKey; //Assign the value BLIO.Log("TimerCheck.Key=" + timerCheckKey.Key + " TimerCheck.Modifiers=" + timerCheckKey.Modifiers); }
/// <summary> /// Looks for key combinations to launch the timer form (to set a timer quickly) /// </summary> /// <param name="sender"></param> /// <param name="e">The keyeventargs which contains the pressed keys</param> private void GlobalKeyPress(object sender, KeyEventArgs e) { if (BLSettings.GetSettings().EnableQuickTimer != 1) //Not enabled? don't do anything { return; } if (!e.Shift && !e.Control && !e.Alt) //None of the key key's (get it?) pressed? return. { return; } //Good! now let's check if the KeyCode is not alt shift or ctr if (e.KeyCode == Keys.Alt || e.KeyCode == Keys.ControlKey || e.KeyCode == Keys.ShiftKey) { return; } timerHotkey = BLHotkeys.TimerPopup; if (e.Modifiers.ToString().Replace(" ", string.Empty) == timerHotkey.Modifiers && e.KeyCode.ToString() == timerHotkey.Key) { BLIO.Log("Timer hotkey combination pressed!"); TimerPopup quickTimer = new TimerPopup(); quickTimer.Show(); } }
private void OnPowerChange(object sender, PowerModeChangedEventArgs e) { BLIO.Log("=== OnPowerChange() ==="); switch (e.Mode) { //PC wakes up from sleep. If you're someone that always puts your pc to sleep instead of turning it off, RemindMe won't get "launched" again //but instead, resumes. case PowerModes.Resume: BLIO.Log("=== PC Woke up from sleep! ==="); Thread t = new Thread(() => { Thread.Sleep(5000); BLIO.Log("Trying to update user after PC Sleep..."); BLOnlineDatabase.InsertOrUpdateUser(BLLocalDatabase.Setting.Settings.UniqueString); BLIO.Log("User updated."); }); t.Start(); break; case PowerModes.Suspend: BLIO.Log("=== PC Is going to sleep. ZzZzzzZzz... ==="); break; } }
private void btnNewUpdate_Click(object sender, EventArgs e) { try { BLIO.Log("Installing the new version from github!"); if (!File.Exists(IOVariables.rootFolder + "SetupRemindMe.msi")) { RemindMeBox.Show("Could not update RemindMe. Please try again later"); BLIO.Log("SetupRemindMe.msi was not found on the hard drive.. hmmmmm... suspicious.... ;)"); return; } ProcessStartInfo info = new ProcessStartInfo(IOVariables.rootFolder + "install.bat"); info.Verb = "runas"; Process process = new Process(); process.StartInfo = info; process.Start(); Application.Exit(); } catch (Exception ex) { MessageFormManager.MakeMessagePopup("Cancelled installation.", 2); BLIO.Log("Cancelled installation."); } }
//launch a form showing the user what is new since the last version(s) private void ShowWhatsNew() { Settings set = BLLocalDatabase.Setting.Settings; if (set.LastVersion != null && (new Version(set.LastVersion) < new Version(IOVariables.RemindMeVersion))) { BLIO.Log("[VERSION CHECK] New version! last version: " + set.LastVersion + " New version: " + IOVariables.RemindMeVersion); //User has a new RemindMe version! string releaseNotesString = ""; foreach (KeyValuePair <string, string> entry in UpdateInformation.ReleaseNotes) { if (new Version(entry.Key) > new Version(set.LastVersion)) { releaseNotesString += "Version " + entry.Key + "\r\n" + entry.Value + "\r\n\r\n\r\n"; } } if (releaseNotesString.Length > 0) { MaterialWhatsNew wn = new MaterialWhatsNew(set.LastVersion, releaseNotesString); materialSkinManager.AddFormToManage(wn); wn.Location = this.Location; wn.Show(); } //Update the lastVersion set.LastVersion = IOVariables.RemindMeVersion; BLLocalDatabase.Setting.UpdateSettings(set); } else { BLIO.Log("[VERSION CHECK] No new version! lastVersion: " + set.LastVersion + " New version: " + IOVariables.RemindMeVersion); } }
private void btnTest_Click(object sender, EventArgs e) { BLIO.Log("(MUCResizePopup)btnAddReminder_Click"); if (testPop == null || testPop.IsDisposed) { testPop = new MaterialPopup(testrem); //create a new instance MaterialSkin.MaterialSkinManager.Instance.AddFormToManage(testPop); testPop.MaximumSize = new Size(int.MaxValue, int.MaxValue); testPop.Width = (int)trbWidth.Value; testPop.Height = (int)trbHeight.Value; testPop.Show(); //show the new instance. } if (!testPop.Visible) { testPop.Show(); testPop.Visible = true; } else { ApplyPreviewChanges(); } refreshTrackbars(); }
static void Main(string[] args) { string resource1 = "RemindMe.Bunifu_UI_v1.5.3.dll"; EmbeddedAssembly.Load(resource1, "Bunifu_UI_v1.5.3.dll"); AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); using (Mutex mutex = new Mutex(false, "Global\\" + "RemindMe")) { if (!mutex.WaitOne(0, false)) { //one instance of remindme already running if (args.Length > 0) {//The user double-clicked an .remindme file! BLIO.Log("Detected the double clicking of a .remindme file!"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new RemindMeImporter(args[0])); } return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); Application.Run(new Form1()); } }
private void btnOk_Click(object sender, EventArgs e) { rem = BLReminder.GetReminderById(rem.Id); if (rem == null) { goto close; } if (rem.Id != -1 && rem.Deleted == 0) //Don't do stuff if the id is -1, invalid. the id is set to -1 when the user previews an reminder { if (BLReminder.GetReminderById(rem.Id) == null) { //The reminder popped up, it existed, but when pressing OK it doesn't exist anymore (maybe the user deleted it or tempered with the .db file) BLIO.Log("DETECTED NONEXISTING REMINDER WITH ID " + rem.Id + ", Attempted to press OK on a reminder that somehow doesn't exist"); goto close; } if (cbPostpone.Checked) { BLIO.Log("Postponing reminder with id " + rem.Id); if (numPostponeTime.Value == 0) { return; } DateTime newReminderTime = new DateTime(); if (cbPostpone.Checked && tbtime.ForeColor == Color.White && !string.IsNullOrWhiteSpace(tbtime.Text)) //postpone option is x minutes { newReminderTime = DateTime.Now.AddMinutes(BLFormLogic.GetTextboxMinutes(tbtime)); rem.PostponeDate = newReminderTime.ToString(); } else { rem.PostponeDate = null; BLReminder.UpdateReminder(rem); } BLIO.Log("Postpone date assigned to reminder"); rem.Enabled = 1; BLReminder.EditReminder(rem); BLIO.Log("Reminder postponed!"); } else { rem.PostponeDate = null; BLReminder.UpdateReminder(rem); } } close: UCReminders.GetInstance().UpdateCurrentPage(); BLIO.Log("Stopping media player & Closing popup"); myPlayer.controls.stop(); btnOk.Enabled = false; this.Close(); }