コード例 #1
0
        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");
            }
        }
コード例 #2
0
ファイル: UCDebugMode.cs プロジェクト: klat-open/RemindMe
        private void btnOpenErrorPrompt_Click(object sender, EventArgs e)
        {
            BLIO.Log("btnOpenErrorPrompt_Click");
            ErrorPopup pop = new ErrorPopup("This is a test error in debug mode", new ReminderException("Test", null));

            pop.Show();
        }
コード例 #3
0
        private static void ShowError(Exception ex, string message, string description)
        {
            //The bunifu framework makes a better looking ui, but it also throws annoying null reference exceptions when disposing an form/usercontrol
            //that has an bunifu control in it(like a button), while there shouldn't be an exception.
            if (!(ex is System.Runtime.InteropServices.ExternalException) && ex.Source != "System.Drawing" && !ex.StackTrace.Contains("GDI+"))
            {
                BLIO.Log("\r\n=====EXCEPTION!!=====\r\n" + ex.GetType().ToString() + "\r\n" + ex.StackTrace + "\r\n");
                ErrorPopup popup;
                if (allowEmail)
                {
                    popup = new ErrorPopup(message + "\r\n" + description, ex);
                    startTimer();
                }
                else
                {
                    popup = new ErrorPopup(message + "\r\n" + description, ex, false);
                }

                popup.Show();
            }
        }
コード例 #4
0
        private void bunifuFlatButton1_Click(object sender, EventArgs e)
        {
            ErrorPopup pop = new ErrorPopup("This is a test error in debug mode", new ReminderException("Test", null), true);

            pop.Show();
        }