Ejemplo n.º 1
0
        private void ErrorPopup_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                string mess = "Oops! An error has occured. Here's the details:\r\n\r\n" + ex.ToString();

                if (ex is ReminderException)
                {
                    ReminderException theException = (ReminderException)ex;
                    theException.Reminder.Note = "Removed for privacy reasons";
                    theException.Reminder.Name = "Removed for privacy reasons";

                    mess += "\r\n\r\nThis exception is an ReminderException! Let's see if we can figure out what's wrong with it....\r\n";
                    mess += "ID:    " + theException.Reminder.Id + "\r\n";
                    mess += "Deleted:    " + theException.Reminder.Deleted + "\r\n";
                    mess += "Date:  " + theException.Reminder.Date + "\r\n";
                    mess += "RepeatType:    " + theException.Reminder.RepeatType + "\r\n";
                    mess += "Enabled:   " + theException.Reminder.Enabled + "\r\n";
                    mess += "DayOfMonth:    " + theException.Reminder.DayOfMonth + "\r\n";
                    mess += "EveryXCustom:  " + theException.Reminder.EveryXCustom + "\r\n";
                    mess += "RepeatDays:    " + theException.Reminder.RepeatDays + "\r\n";
                    mess += "SoundFilePath: " + theException.Reminder.SoundFilePath + "\r\n";
                    mess += "PostponeDate:  " + theException.Reminder.PostponeDate + "\r\n";
                    mess += "Hide:  " + theException.Reminder.Hide + "\r\n\r\n";

                    mess += "=== Displaying date culture info, so you might be able to re-create the reminder ===\r\n";
                    mess += "Current culture DisplayName: " + CultureInfo.CurrentCulture.DisplayName + "\r\n";
                    mess += "Current culture ShortTimePattern: " + CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern + "\r\n";
                    mess += "Current culture ShortDatePattern: " + CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern + "\r\n";
                    mess += "Current culture ToString(): " + CultureInfo.CurrentCulture.ToString() + "\r\n";
                }
                BLOnlineDatabase.AddException(ex, DateTime.UtcNow, BLIO.GetLogTxtPath());
            }
            catch { }
        }
Ejemplo n.º 2
0
        private void ErrorPopup_FormClosing(object sender, FormClosingEventArgs e)
        {
            //!sendCustomEmail = If the user has not given a description of the exception and sent it.
            //allowEmail determines if we are allowed to send an e-mail(it's only allowed once every 30 seconds to prevent spam)
            if (!sentCustomEmail && allowEmail)
            {
                try
                {
                    string mess = "Oops! An error has occured. Here's the details:\r\n\r\n" + ex.ToString();

                    if (ex is ReminderException)
                    {
                        ReminderException theException = (ReminderException)ex;
                        theException.Reminder.Note = "Removed for privacy reasons";
                        theException.Reminder.Name = "Removed for privacy reasons";

                        mess += "\r\n\r\nThis exception is an ReminderException! Let's see if we can figure out what's wrong with it....\r\n";
                        mess += "ID:    " + theException.Reminder.Id + "\r\n";
                        mess += "Deleted:    " + theException.Reminder.Deleted + "\r\n";
                        mess += "Date:  " + theException.Reminder.Date + "\r\n";
                        mess += "RepeatType:    " + theException.Reminder.RepeatType + "\r\n";
                        mess += "Enabled:   " + theException.Reminder.Enabled + "\r\n";
                        mess += "DayOfMonth:    " + theException.Reminder.DayOfMonth + "\r\n";
                        mess += "EveryXCustom:  " + theException.Reminder.EveryXCustom + "\r\n";
                        mess += "RepeatDays:    " + theException.Reminder.RepeatDays + "\r\n";
                        mess += "SoundFilePath: " + theException.Reminder.SoundFilePath + "\r\n";
                        mess += "PostponeDate:  " + theException.Reminder.PostponeDate + "\r\n";
                        mess += "Hide:  " + theException.Reminder.Hide + "\r\n\r\n";

                        mess += "=== Displaying date culture info, so you might be able to re-create the reminder ===\r\n";
                        mess += "Current culture DisplayName: " + CultureInfo.CurrentCulture.DisplayName + "\r\n";
                        mess += "Current culture ShortTimePattern: " + CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern + "\r\n";
                        mess += "Current culture ShortDatePattern: " + CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern + "\r\n";
                        mess += "Current culture ToString(): " + CultureInfo.CurrentCulture.ToString() + "\r\n";
                    }

                    Thread sendMailThread = new Thread(() => BLEmail.SendEmail("Error Report: " + ex.GetType().ToString(), mess));
                    sendMailThread.Start();
                }
                catch { }
            }
        }
Ejemplo n.º 3
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                string textBoxText = tbNote.Text; //Cant access tbNote in a thread. save the text in a variable instead
                string customMess  = "[CUSTOM USER INPUT]\r\n" + textBoxText + "\r\n\r\n---------------Default below--------------------\r\nOops! An error has occured. Here's the details:\r\n\r\n" + ex.ToString();

                if (ex is ReminderException)
                {
                    ReminderException theException = (ReminderException)ex;
                    if (theException.Reminder != null)
                    {
                        theException.Reminder.Note = "Removed for privacy reasons";
                        theException.Reminder.Name = "Removed for privacy reasons";

                        customMess += "\r\n\r\nThis exception is an ReminderException! Let's see if we can figure out what's wrong with it....\r\n";
                        customMess += "ID:    " + theException.Reminder.Id + "\r\n";
                        customMess += "Deleted:    " + theException.Reminder.Deleted + "\r\n";
                        customMess += "Date:  " + theException.Reminder.Date + "\r\n";
                        customMess += "RepeatType:    " + theException.Reminder.RepeatType + "\r\n";
                        customMess += "Enabled:   " + theException.Reminder.Enabled + "\r\n";
                        customMess += "DayOfMonth:    " + theException.Reminder.DayOfMonth + "\r\n";
                        customMess += "EveryXCustom:  " + theException.Reminder.EveryXCustom + "\r\n";
                        customMess += "RepeatDays:    " + theException.Reminder.RepeatDays + "\r\n";
                        customMess += "SoundFilePath: " + theException.Reminder.SoundFilePath + "\r\n";
                        customMess += "PostponeDate:  " + theException.Reminder.PostponeDate + "\r\n";
                        customMess += "Hide:  " + theException.Reminder.Hide + "\r\n";
                    }
                }

                Thread sendMailThread = new Thread(() => BLEmail.SendEmail("[CUSTOM] | Error Report: " + ex.GetType().ToString(), customMess));
                sendMailThread.Start();
                MessageFormManager.MakeMessagePopup("Feedback sent.\r\nThank you for taking the time!", 5);
                this.Dispose();
            }
            catch { }


            //Set this boolean to true so that when this popup closes, we won't try to send another e-mail
            sentCustomEmail = true;
        }
Ejemplo n.º 4
0
        //All uncaught exceptions will go here instead. We will replace the default windows popup with our own custom one and filter out what kind of exception is being thrown
        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            if (e.Exception is ReminderException)
            {
                ReminderException theException = (ReminderException)e.Exception;
                BLIO.WriteError(e.Exception, "Error with this reminder (" + theException.Reminder.Name + ") !");
                ShowError(e.Exception, "Reminder error!", theException.Message);
                UCReminders.GetInstance().UpdateCurrentPage();
            }
            else if (e.Exception is DirectoryNotFoundException)
            {
                DirectoryNotFoundException theException = (DirectoryNotFoundException)e.Exception;
                BLIO.WriteError(theException, "Folder not found.");
                ShowError(e.Exception, e.Exception.GetType().ToString(), theException.Message);
            }

            else if (e.Exception is UnauthorizedAccessException)
            {
                UnauthorizedAccessException theException = (UnauthorizedAccessException)e.Exception;
                BLIO.WriteError(e.Exception, "Unauthorized!");
                ShowError(e.Exception, "Unauthorized!", "RemindMe is not authorized for this action.\r\nThis can be resolved by running RemindMe in administrator-mode.");
            }

            //Here we just filter out some type of exceptions and give different messages, at the bottom is the super Exception, which can be anything.
            else if (e.Exception is FileNotFoundException)
            {
                FileNotFoundException theException = (FileNotFoundException)e.Exception; //needs in instance to call .FileName
                BLIO.WriteError(theException, "Could not find the file located at \"" + theException.FileName);
                ShowError(e.Exception, "File not found.", "Could not find the file located at \"" + theException.FileName + "\"\r\nHave you moved,renamed or deleted the file?");
            }

            else if (e.Exception is System.Data.Entity.Core.EntityException)
            {
                BLIO.WriteError(e.Exception, "System.Data.Entity.Core.EntityException");
                ShowError(e.Exception, "System.Data.Entity.Core.EntityException", "There was a problem executing SQL!");
            }

            else if (e.Exception is ArgumentNullException)
            {
                BLIO.WriteError(e.Exception, "Null argument");
                ShowError(e.Exception, "Null argument", "Null argument exception! Whoops! this is not on your end!");
            }

            else if (e.Exception is NullReferenceException)
            {
                BLIO.WriteError(e.Exception, "Null reference");
                ShowError(e.Exception, "Null reference", "Null reference exception! Whoops! this is not on your end!");
            }

            else if (e.Exception is SQLiteException)
            {
                BLIO.WriteError(e.Exception, "SQLite Database exception");
                ShowError(e.Exception, "SQLite Database exception", "Remindme has encountered a database error!\r\nThis might or might not be on your end. It can be on your end if you modified the database file");
            }

            else if (e.Exception is PathTooLongException)
            {
                BLIO.WriteError(e.Exception, "The path to the file is too long.");
                ShowError(e.Exception, "File Path too long.", "The path to the file is too long!.");
            }

            else if (e.Exception is StackOverflowException)
            {
                BLIO.WriteError(e.Exception, "StackOverFlowException");
                ShowError(e.Exception, "StackOverFlowException", "RemindMe has encountered a stackoverflow! This is probably not your fault. Sorry!");
            }

            else if (e.Exception is OutOfMemoryException)
            {
                BLIO.WriteError(e.Exception, "Out of Memory");
                ShowError(e.Exception, "Out of Memory", "RemindMe is out of memory!");
            }
            else if (e.Exception is DbUpdateConcurrencyException)
            {
                BLIO.WriteError(e.Exception, "Database error.");
                ShowError(e.Exception, "Database error!", "Database error encountered!");
            }

            else if (e.Exception is Exception)
            {
                BLIO.WriteError(e.Exception, "Unknown exception in main.");
                ShowError(e.Exception, "Unknown", "Unknown exception in main.");
            }
        }
Ejemplo n.º 5
0
        private void Popup_Load(object sender, EventArgs e)
        {
            try
            {
                BLIO.Log("Popup_load");

                if (BLLocalDatabase.Setting.Settings.PopupType == "SoundOnly")
                {
                    //Dont initialize, just play sound
                    PlayReminderSound();

                    if (rem.Id != -1) //Dont stop logic when the user is previewing an reminder
                    {
                        btnOk_Click(sender, e);
                        return;
                    }
                }

                string reminderText = rem.Note != null?rem.Note.Replace("\n", "<br>") : "( No text set )";

                //White font if dark theme, Black text if light theme
                string color = MaterialSkin.MaterialSkinManager.Instance.Theme == MaterialSkin.MaterialSkinManager.Themes.DARK ? "#e6e6e6" : "#323232";

                if (rem.Note.Contains("API{"))
                {
                    TransformAPITextToValue(color, reminderText);
                }
                else
                {
                    htmlLblText.Text = GetPopupHTMLText(color, reminderText);
                }


                AdvancedReminderProperties          avrProps = BLLocalDatabase.AVRProperty.GetAVRProperties(rem.Id);
                List <AdvancedReminderFilesFolders> avrFF    = BLLocalDatabase.AVRProperty.GetAVRFilesFolders(rem.Id);
                if (avrProps != null) //Not null? this reminder has advanced properties.
                {
                    BLIO.Log("Reminder " + rem.Id + " has advanced reminder properties!");
                    this.Visible = avrProps.ShowReminder == 1;

                    if (!string.IsNullOrWhiteSpace(avrProps.BatchScript))
                    {
                        //if (!this.Visible)
                        MaterialMessageFormManager.MakeMessagePopup("Activating script of Reminder:\r\n \"" + rem.Name + "\"", 3);

                        BLIO.ExecuteBatch(avrProps.BatchScript);
                    }
                }
                else
                {
                    BLIO.Log("Reminder " + rem.Id + " does not have advanced reminder properties");
                }

                if (avrFF != null && avrFF.Count > 0)
                {
                    //Go through each action, for example c:\test , delete. c:\sometest\testFile.txt , open
                    foreach (AdvancedReminderFilesFolders avr in avrFF)
                    {
                        if (avr.Action.ToString() == "Open")
                        {
                            BLIO.Log("Executing advanced reminder action \"Open\"");

                            if (File.Exists(avr.Path) || Directory.Exists(avr.Path))
                            {
                                System.Diagnostics.Process.Start(avr.Path);
                            }
                        }
                        else if (avr.Action.ToString() == "Delete")
                        {
                            BLIO.Log("Executing advanced reminder action \"Delete\"");

                            FileAttributes attr = File.GetAttributes(avr.Path);
                            //Check if it's a file or a directory
                            if (File.Exists(avr.Path))
                            {
                                File.Delete(avr.Path);
                            }
                            else if (Directory.Exists(avr.Path))
                            {
                                Directory.Delete(avr.Path, true);
                            }
                        }
                    }
                }

                if (this.Visible)
                {
                    tmrFadeIn.Start();
                }
                else
                {
                    btnOk_Click(sender, e);
                    return;
                }

                if (rem.HttpId == null)
                {
                    BLIO.Log("Attempting to parse date...");
                    DateTime date = Convert.ToDateTime(rem.Date.Split(',')[0]);
                    BLIO.Log("Date succesfully converted (" + date + ")");

                    lblSmallDate.Text = date.ToShortDateString() + " " + date.ToShortTimeString();
                }
                else
                {
                    lblSmallDate.Text = "Conditional";
                }


                lblRepeat.Text = BLReminder.GetRepeatTypeText(rem);

                if (!string.IsNullOrWhiteSpace(rem.PostponeDate))
                {
                    BLIO.Log("Reminder has a postpone date.");

                    pbDate.BackgroundImage = Properties.Resources.RemindMeZzz;
                    lblSmallDate.Text      = Convert.ToDateTime(rem.PostponeDate) + "";
                }

                //If some country has a longer date string, move the repeat icon/text more to the right so it doesnt overlap
                while (lblSmallDate.Bounds.IntersectsWith(pbRepeat.Bounds))
                {
                    pbRepeat.Location  = new Point(pbRepeat.Location.X + 5, pbRepeat.Location.Y);
                    lblRepeat.Location = new Point(lblRepeat.Location.X + 5, lblRepeat.Location.Y);
                }

                PlayReminderSound();

                FlashWindowHelper.Start(this);
                //this.MaximumSize = this.Size;

                if (BLLocalDatabase.Setting.Settings.PopupType == "AlwaysOnTop")
                {
                    this.TopMost  = true; //Popup will be always on top. no matter what you are doing, playing a game, watching a video, you will ALWAYS see the popup.
                    this.TopLevel = true;
                }
                else
                {
                    if (rem.Id != -1) //previewreminders should be topmost
                    {
                        this.TopMost     = false;
                        this.WindowState = FormWindowState.Minimized;
                    }
                }


                this.Text = rem.Name;
                string hexColor = ColorToHex(MaterialSkin.MaterialSkinManager.Instance.ColorScheme.AccentColor);

                foreach (string link in GetLinks(htmlLblText.Text)) //Add <a href> to make it into an actual link
                {
                    htmlLblText.Text = htmlLblText.Text.Replace(link, "<a href=\"" + link + "\" style=\"color: " + hexColor + "\"> " + link + "</a>");
                }

                if (rem.Date == null && rem.HttpId == null)
                {
                    rem.Date = DateTime.Now.ToString();
                }
            }
            catch (Exception ex)
            {
                ReminderException remEx = new ReminderException(BLReminder.ToString(rem), rem);
                remEx.StackTrace = ex.StackTrace; //Copy the stacktrace

                BLIO.WriteError(remEx, "Error loading reminder popup");
                BLIO.Log("Popup_load FAILED. Exception -> " + ex.Message);
            }
        }
Ejemplo n.º 6
0
        private void Popup2_Load(object sender, EventArgs e)
        {
            try
            {
                BLIO.Log("Popup_load");
                AdvancedReminderProperties          avrProps = BLLocalDatabase.AVRProperty.GetAVRProperties(rem.Id);
                List <AdvancedReminderFilesFolders> avrFF    = BLLocalDatabase.AVRProperty.GetAVRFilesFolders(rem.Id);
                if (avrProps != null) //Not null? this reminder has advanced properties.
                {
                    BLIO.Log("Reminder " + rem.Id + " has advanced reminder properties!");
                    this.Visible = avrProps.ShowReminder == 1;

                    if (!string.IsNullOrWhiteSpace(avrProps.BatchScript))
                    {
                        if (!this.Visible)
                        {
                            RemindMeMessageFormManager.MakeMessagePopup("Activating script of Reminder:\r\n \"" + rem.Name + "\"", 3);
                        }

                        BLIO.ExecuteBatch(avrProps.BatchScript);
                    }
                }
                else
                {
                    BLIO.Log("Reminder " + rem.Id + " does not have advanced reminder properties");
                }

                if (avrFF != null && avrFF.Count > 0)
                {
                    //Go through each action, for example c:\test , delete. c:\sometest\testFile.txt , open
                    foreach (AdvancedReminderFilesFolders avr in avrFF)
                    {
                        if (avr.Action.ToString() == "Open")
                        {
                            BLIO.Log("Executing advanced reminder action \"Open\"");

                            if (File.Exists(avr.Path) || Directory.Exists(avr.Path))
                            {
                                System.Diagnostics.Process.Start(avr.Path);
                            }
                        }
                        else if (avr.Action.ToString() == "Delete")
                        {
                            BLIO.Log("Executing advanced reminder action \"Delete\"");

                            FileAttributes attr = File.GetAttributes(avr.Path);
                            //Check if it's a file or a directory
                            if (File.Exists(avr.Path))
                            {
                                File.Delete(avr.Path);
                            }
                            else if (Directory.Exists(avr.Path))
                            {
                                Directory.Delete(avr.Path, true);
                            }
                        }
                    }
                }

                if (this.Visible)
                {
                    tmrFadeIn.Start();
                }
                else
                {
                    btnOk_Click(sender, e);
                    return;
                }

                BLIO.Log("Attempting to parse date...");
                DateTime date = Convert.ToDateTime(rem.Date.Split(',')[0]);
                BLIO.Log("Date succesfully converted (" + date + ")");

                lblSmallDate.Text = date.ToShortDateString() + " " + date.ToShortTimeString();
                lblRepeat.Text    = BLReminder.GetRepeatTypeText(rem);

                if (!string.IsNullOrWhiteSpace(rem.PostponeDate))
                {
                    BLIO.Log("Reminder has a postpone date.");

                    pbDate.BackgroundImage = Properties.Resources.RemindMeZzz;
                    lblSmallDate.Text      = Convert.ToDateTime(rem.PostponeDate) + " (Postponed)";
                }

                //If some country has a longer date string, move the repeat icon/text more to the right so it doesnt overlap
                while (lblSmallDate.Bounds.IntersectsWith(pbRepeat.Bounds))
                {
                    pbRepeat.Location  = new Point(pbRepeat.Location.X + 5, pbRepeat.Location.Y);
                    lblRepeat.Location = new Point(lblRepeat.Location.X + 5, lblRepeat.Location.Y);
                }

                //Play the sound
                if (rem.SoundFilePath != null && rem.SoundFilePath != "")
                {
                    if (System.IO.File.Exists(rem.SoundFilePath))
                    {
                        BLIO.Log("SoundFilePath not null / empty and exists on the hard drive!");
                        myPlayer.URL = rem.SoundFilePath;
                        myPlayer.controls.play();
                        BLIO.Log("Playing sound");
                    }
                    else
                    {
                        BLIO.Log("SoundFilePath not null / empty but doesn't exist on the hard drive!");
                        RemindMeBox.Show("Could not play " + Path.GetFileNameWithoutExtension(rem.SoundFilePath) + " located at \"" + rem.SoundFilePath + "\" \r\nDid you move,rename or delete the file ?\r\nThe sound effect has been removed from this reminder. If you wish to re-add it, select it from the drop-down list.", RemindMeBoxReason.OK);
                        //make sure its removed from the reminder
                        rem.SoundFilePath = "";
                    }
                }

                FlashWindowHelper.Start(this);
                //this.MaximumSize = this.Size;

                if (BLLocalDatabase.Setting.IsAlwaysOnTop())
                {
                    this.TopMost  = true; //Popup will be always on top. no matter what you are doing, playing a game, watching a video, you will ALWAYS see the popup.
                    this.TopLevel = true;
                }
                else
                {
                    this.TopMost     = false;
                    this.WindowState = FormWindowState.Minimized;
                }


                lblTitle.Text = rem.Name;

                if (rem.Note != null)
                {
                    lblNoteText.Text = rem.Note.Replace("\\n", Environment.NewLine);
                }

                if (rem.Note == "")
                {
                    lblNoteText.Text = "( No text set )";
                }

                lblNoteText.Text = Environment.NewLine + lblNoteText.Text;



                if (rem.Date == null)
                {
                    rem.Date = DateTime.Now.ToString();
                }
            }
            catch (Exception ex)
            {
                ReminderException remEx = new ReminderException(BLReminder.ToString(rem), rem);
                remEx.StackTrace = ex.StackTrace; //Copy the stacktrace

                BLIO.WriteError(remEx, "Error loading reminder popup");
                BLIO.Log("Popup_load FAILED. Exception -> " + ex.Message);
            }
        }
Ejemplo n.º 7
0
        //All uncaught exceptions will go here instead. We will replace the default windows popup with our own custom one and filter out what kind of exception is being thrown
        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            //Here we just filter out some type of exceptions and give different messages, at the bottom is the super Exception, which can be anything.
            BLIO.Log("Application_ThreadException [ " + e.Exception + " ]");
            if (e.Exception is ReminderException)
            {
                ReminderException theException = (ReminderException)e.Exception;
                BLIO.WriteError(e.Exception, "Error with this reminder (" + theException.Reminder.Name + ") !", false);
                ShowError(e.Exception, "Reminder error!", theException.Message);
                UCReminders.Instance.UpdateCurrentPage();
            }
            else if (e.Exception is DbEntityValidationException)
            {
                Exception raise = (DbEntityValidationException)e.Exception;
                DbEntityValidationException ex = (DbEntityValidationException)e.Exception;
                foreach (var validationErrors in ex.EntityValidationErrors)
                {
                    foreach (var validationError in validationErrors.ValidationErrors)
                    {
                        string message = string.Format("{0}:{1}",
                                                       validationErrors.Entry.Entity.ToString(),
                                                       validationError.ErrorMessage);
                        // raise a new exception nesting
                        // the current instance as InnerException
                        raise = new InvalidOperationException(message, raise);
                    }
                }
                BLIO.WriteError(raise, raise.Message, false);
                ShowError(e.Exception, e.Exception.GetType().ToString(), raise.Message);
            }
            else if (e.Exception is ArgumentException)
            {
                ArgumentException theException = (ArgumentException)e.Exception;
                BLIO.WriteError(theException, "Invalid argument.", false);
                ShowError(e.Exception, e.Exception.GetType().ToString(), theException.Message);
            }
            else if (e.Exception is DirectoryNotFoundException)
            {
                DirectoryNotFoundException theException = (DirectoryNotFoundException)e.Exception;
                BLIO.WriteError(theException, "Folder not found.", false);
                ShowError(e.Exception, e.Exception.GetType().ToString(), theException.Message);
            }

            else if (e.Exception is UnauthorizedAccessException)
            {
                UnauthorizedAccessException theException = (UnauthorizedAccessException)e.Exception;
                BLIO.WriteError(e.Exception, "Unauthorized!");
                ShowError(e.Exception, "Unauthorized!", "RemindMe is not authorized for this action.\r\nThis can be resolved by running RemindMe in administrator-mode.");
            }

            else if (e.Exception is FileNotFoundException)
            {
                FileNotFoundException theException = (FileNotFoundException)e.Exception; //needs in instance to call .FileName
                BLIO.WriteError(theException, "Could not find the file located at \"" + theException.FileName, false);
                ShowError(e.Exception, "File not found.", "Could not find file \"" + theException.FileName + "\"\r\nHave you moved,renamed or deleted it?");
            }

            else if (e.Exception is System.Data.Entity.Core.EntityException || e.Exception is System.Data.Entity.Core.EntityCommandExecutionException)
            {
                BLIO.WriteError(e.Exception, "System.Data.Entity.Core exception", false);
                ShowError(e.Exception, "System.Data.Entity.Core.EntityException", "There was a problem executing SQL!");
            }

            else if (e.Exception is System.Runtime.InteropServices.COMException && e.Exception.Message.ToLower().Contains("database"))
            {
                BLIO.WriteError(e.Exception, "Database error.");
                ShowError(e.Exception, "System.Data.Entity.Core.EntityException", "There was a problem executing SQL!");
            }

            else if (e.Exception is ArgumentNullException)
            {
                BLIO.WriteError(e.Exception, "Null argument", false);
                ShowError(e.Exception, "Null argument", "Null argument exception! Whoops! this is not on your end!");
            }

            else if (e.Exception is NullReferenceException)
            {
                BLIO.WriteError(e.Exception, "Null reference", false);
                ShowError(e.Exception, "Null reference", "Null reference exception! Whoops! this is not on your end!");
            }

            else if (e.Exception.GetType().ToString() == "SQLiteException") //SQLiteException could not be found error, fkin weird
            {
                BLIO.WriteError(e.Exception, "SQLite Database exception", false);
                ShowError(e.Exception, "SQLite Database exception", "Remindme has encountered a database error!\r\nThis might or might not be on your end. It can be on your end if you modified the database file");
            }

            else if (e.Exception is PathTooLongException)
            {
                BLIO.WriteError(e.Exception, "The path to the file is too long.", false);
                ShowError(e.Exception, "File Path too long.", "The path to the file is too long!.");
            }

            else if (e.Exception is StackOverflowException)
            {
                BLIO.WriteError(e.Exception, "StackOverFlowException", false);
                ShowError(e.Exception, "StackOverFlowException", "RemindMe has encountered a stackoverflow! This is probably not your fault. Sorry!");
            }

            else if (e.Exception is OutOfMemoryException)
            {
                BLIO.WriteError(e.Exception, "Out of Memory", false);
                ShowError(e.Exception, "Out of Memory", "RemindMe is out of memory!");
            }
            else if (e.Exception is DbUpdateConcurrencyException)
            {
                BLIO.WriteError(e.Exception, "Database error.", false);
                ShowError(e.Exception, "Database error!", "Database error encountered!");
            }
            else if (e.Exception is IOException)
            {
                BLIO.WriteError(e.Exception, "IO Exception.");

                if (!e.Exception.StackTrace.Contains("UpdateFiles.zip"))
                {
                    ShowError(e.Exception, "File error!", "RemindMe has encountered an IO issue.");
                }
            }

            else if (e.Exception is Exception)
            {
                BLIO.WriteError(e.Exception, "Unknown exception in main.", false);
                ShowError(e.Exception, "Unknown", "Unknown exception in main.");
            }
        }