private void btnImport_Click(object sender, EventArgs e) { try { if (lvReminders.SelectedItems.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 { MaterialMessageFormManager.MakeMessagePopup("Please select at least one reminder.", 3); } } catch (Exception ex) { MaterialExceptionPopup pop = new MaterialExceptionPopup(ex, "Error inserting reminders"); pop.Show(); BLIO.WriteError(ex, "Error inserting reminders"); } }
private void btnOpenErrorPrompt_Click(object sender, EventArgs e) { BLIO.Log("btnOpenErrorPrompt_Click"); string text = MaterialRemindMePrompt.ShowText("Enter a message"); MaterialExceptionPopup pop = new MaterialExceptionPopup(new ReminderException("Test", null), text); pop.Show(); }