Exemplo n.º 1
0
        public RemindMeMessageForm(string message, int timeout)
        {
            BLIO.Log("Constructing RemindMeMessageForm (" + message + ")");
            InitializeComponent();

            //Not visible
            this.Opacity = 0.0;
            //Make it so that the text won't go out of bounds horizontally, so the panel has to grow vertically
            lblText.MaximumSize = new Size(pnlText.Width - 15, 0);
            //Set the text
            lblText.Text = message;
            //Enlarge the panel if needed
            FitPanel(pnlText);


            //No active popup forms? set it to default position
            if (MessageFormManager.GetPopupforms().Count == 0)
            {
                //Set the location to the bottom right corner of the user's screen and a little bit above the taskbar
                this.Location = new Point(Screen.GetWorkingArea(this).Width - this.Width - 5, Screen.GetWorkingArea(this).Height - this.Height - 5);
            }
            else
            {
                int alreadyActiveFormCount = MessageFormManager.GetPopupforms().Count;
                //Set the location to the bottom right corner of the user's screen, and above all other active popups
                this.Location = new Point(Screen.GetWorkingArea(this).Width - this.Width - 5, Screen.GetWorkingArea(this).Height - (this.Height * (alreadyActiveFormCount + 1)) - ((alreadyActiveFormCount + 1) * 5));
            }

            this.timeout = timeout;
            //Start the timer that will "slowly" make the form more transparent
            tmrFadein.Start();
            BLIO.Log("RemindMeMessageForm constructed");
        }
Exemplo n.º 2
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
                {
                    MessageFormManager.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");
            }
        }
Exemplo n.º 3
0
        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.");
            }
        }
Exemplo n.º 4
0
        private void btnReset_Click(object sender, EventArgs e)
        {
            BLPopupDimensions.ResetToDefaults();
            MessageFormManager.MakeMessagePopup("Succesfully reset settings.", 4);

            FillValues();
            ApplyPreviewChanges();
        }
Exemplo n.º 5
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            try
            {
                string email   = tbEmail.Text;
                string subject = tbSubject.Text;
                string note    = tbNote.Text;

                if (tmrAllowMail.Enabled)
                {
                    RemindMeBox.Show("You have recently sent an e-mail. Wait a bit before you do it again!");
                    return;
                }

                if (!string.IsNullOrWhiteSpace(subject) && !string.IsNullOrWhiteSpace(note))
                {
                    lblSending.Visible = true;
                    pbSending.Visible  = true;
                    btnSend.Enabled    = false;



                    // TimeSpan timeout = TimeSpan.FromSeconds(5);
                    if (string.IsNullOrWhiteSpace(email))
                    {
                        sendMailThread = new Thread(() => sendMailException = BLEmail.SendEmail(subject, note, false));
                    }
                    else
                    {
                        try
                        {
                            MailMessage mes = new MailMessage(email, "*****@*****.**", subject, note);
                            sendMailThread = new Thread(() => sendMailException = BLEmail.SendEmail(subject, note, email, false));
                        }
                        catch (FormatException ex)
                        {
                            btnSend.Enabled    = true;
                            lblSending.Visible = false;
                            pbSending.Visible  = false;
                            RemindMeBox.Show("Please enter a valid e-mail address, or leave it empty");
                        }
                    }

                    if (sendMailThread != null)
                    {
                        sendMailThread.Start();
                        tmrSendMail.Start();
                        tbEmail.ResetText();
                        tbNote.ResetText();
                        tbSubject.ResetText();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageFormManager.MakeMessagePopup("Something went wrong. Could not send the e-mail", 3);
            }
        }
Exemplo n.º 6
0
        private bool Exportreminders()
        {
            if (GetSelectedRemindersFromListview().Count > 0)
            {
                string selectedPath = FSManager.Folders.GetSelectedFolderPath();

                if (selectedPath != null)
                {
                    BLIO.Log("User selected a valid path");

                    Exception possibleException = BLReminder.ExportReminders(GetSelectedRemindersFromListview(), selectedPath);
                    if (possibleException == null)
                    {
                        BLIO.Log("No problems encountered (exception null)");
                        SetStatusTexts(GetSelectedRemindersFromListview().Count, BLReminder.GetReminders().Count);
                    }
                    else if (possibleException is UnauthorizedAccessException)
                    {
                        BLIO.Log("Problem encountered: Unauthorized");
                        if (RemindMeBox.Show("Could not save reminders to \"" + selectedPath + "\"\r\nDo you wish to place them on your desktop instead?", RemindMeBoxReason.YesNo) == DialogResult.Yes)
                        {
                            BLIO.Log("Trying to save to desktop instead...");
                            possibleException = BLReminder.ExportReminders(GetSelectedRemindersFromListview(), Environment.GetFolderPath(Environment.SpecialFolder.Desktop));
                            if (possibleException != null)
                            {//Did saving to desktop go wrong, too?? just show a message
                                BLIO.Log("Trying to save to desktop didnt work either");
                                RemindMeBox.Show("Something went wrong. Could not save the reminders to your desktop.", RemindMeBoxReason.OK);
                                return(false);
                            }
                            else
                            {//Saving to desktop did not throw an exception
                                BLIO.Log("Saved to desktop");
                                SetStatusTexts(GetSelectedRemindersFromListview().Count, BLReminder.GetReminders().Count);
                            }
                        }
                    }
                    else
                    {
                        MessageFormManager.MakeMessagePopup("Backup failed.", 6);
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                MessageFormManager.MakeMessagePopup("Please select one or more reminder(s)", 6);
            }
            return(true);
        }
Exemplo n.º 7
0
        private void SetStatusTexts(int completedReminders, int totalReminders)
        {
            foreach (ListViewItem item in lvReminders.CheckedItems)
            {
                lvReminders.Items.Remove(item);
            }

            if (completedReminders > 0)
            {
                MessageFormManager.MakeMessagePopup("Succesfully " + this.transferType.ToString().ToLower() + "ed " + completedReminders + " reminders.", 4);
            }
        }
Exemplo n.º 8
0
 private void tmrSendMail_Tick(object sender, EventArgs e)
 {
     try
     {
         if (sendMailThread.IsAlive)
         {
             if (secondsPassed >= timeout)
             {
                 sendMailThread.Abort();
                 btnSend.Enabled    = true;
                 pbSending.Visible  = false;
                 lblSending.Visible = false;
                 MessageFormManager.MakeMessagePopup("Could not send the e-mail from your connection.", 5);
                 tmrSendMail.Stop();
                 secondsPassed = 0;
             }
         }
         else
         {
             lblSending.Visible = false;
             pbSending.Visible  = false;
             tmrSendMail.Stop();
             if (sendMailException == null)
             {
                 tmrAllowMail.Start();
                 sendMailThread = null;
                 MessageFormManager.MakeMessagePopup("E-mail Sent. Thank you!", 5);
             }
             else
             {
                 if (sendMailException is FormatException)
                 {
                     RemindMeBox.Show("Please enter a valid e-mail address, or leave it empty");
                 }
                 else
                 {
                     MessageFormManager.MakeMessagePopup("Could not send the e-mail :(", 3);     //No clue what happened
                 }
                 secondsPassed   = 0;
                 btnSend.Enabled = true;
             }
         }
         secondsPassed++;
     }
     catch (Exception ex)
     {
         BLIO.Log("Exception in tmrSendMail_Tick: " + ex.ToString());
         tmrSendMail.Stop();
     }
 }
Exemplo n.º 9
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            if (lvSoundFiles.SelectedItems.Count == 1)
            {
                Songs selectedSong = BLSongs.GetSongById((long)lvSoundFiles.SelectedItems[0].Tag);
                BLIO.Log("Attempting to preview sound file with id " + selectedSong.Id);

                if (btnPreview.Iconimage == imgPlay)
                {
                    if (System.IO.File.Exists(selectedSong.SongFilePath))
                    {
                        BLIO.Log("Sound file exists on the hard drive");
                        btnPreview.Iconimage = imgStop;

                        myPlayer.URL = selectedSong.SongFilePath;
                        mediaInfo    = myPlayer.newMedia(myPlayer.URL);

                        //Start the timer. the timer ticks when the song ends. The timer will then reset the picture of the play button
                        if (mediaInfo.duration > 0)
                        {
                            tmrMusic.Interval = (int)(mediaInfo.duration * 1000);
                        }
                        else
                        {
                            tmrMusic.Interval = 1000;
                        }
                        tmrMusic.Start();


                        myPlayer.controls.play();
                        BLIO.Log("Playing sound.");
                    }
                    else
                    {
                        MessageFormManager.MakeMessagePopup("Could not preview the selected song. Does it still exist?", 4);
                    }
                }
                else
                {
                    BLIO.Log("Stopping sound");
                    btnPreview.Iconimage = imgPlay;
                    myPlayer.controls.stop();
                    tmrMusic.Stop();
                }
            }
        }
Exemplo n.º 10
0
        private void btnRemoveFiles_Click(object sender, EventArgs e)
        {
            List <Songs> toRemoveSongs = new List <Songs>();

            foreach (ListViewItem selectedItem in lvSoundFiles.SelectedItems)
            {
                toRemoveSongs.Add(BLSongs.GetSongById(Convert.ToInt32(selectedItem.Tag)));
                lvSoundFiles.Items.Remove(selectedItem);
            }

            BLSongs.RemoveSongs(toRemoveSongs);

            if (toRemoveSongs.Count > 0)
            {
                MessageFormManager.MakeMessagePopup(toRemoveSongs.Count + " Files removed from RemindMe.", 4);
            }
        }
Exemplo n.º 11
0
        private void SaveChanges()
        {
            try
            {
                PopupDimensions dimension = new PopupDimensions();
                dimension.FontNoteSize  = (long)trbNoteFont.Value;
                dimension.FontTitleSize = (long)trbTitleFont.Value;
                dimension.FormWidth     = (long)trbWidth.Value;
                dimension.FormHeight    = (long)trbHeight.Value;
                BLPopupDimensions.UpdatePopupDimensions(dimension);


                MessageFormManager.MakeMessagePopup("Succesfully changed settings.", 4);
            }
            catch
            {
                MessageFormManager.MakeMessagePopup("Changing settings failed", 4);
            }
        }
Exemplo n.º 12
0
        protected override void WndProc(ref Message m)
        {
            //This message will be sent when the RemindMeImporter imports reminders.
            if (m.Msg == WM_RELOAD_REMINDERS)
            {
                BLIO.Log("Received message WM_RELOAD_REMINDERS");
                int currentReminderCount = BLReminder.GetReminders().Count;

                BLReminder.NotifyChange();
                UCReminders.GetInstance().UpdateCurrentPage();

                if (!this.Visible) //don't make this message if RemindMe is visible, the user will see the changes if it is visible.
                {
                    MessageFormManager.MakeMessagePopup(BLReminder.GetReminders().Count - currentReminderCount + " Reminder(s) succesfully imported!", 3);
                    BLIO.Log("Created reminders succesfully imported message popup (WndProc)");
                }
            }

            base.WndProc(ref m);
        }
Exemplo n.º 13
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;
        }
Exemplo n.º 14
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            BLIO.Log("Import button pressed. Loading reminders into listview");
            remindersFromRemindMeFile.Clear();
            ToggleButton(sender);
            lvReminders.Items.Clear();

            string remindmeFile = FSManager.Files.GetSelectedFileWithPath("RemindMe backup file", "*.remindme");

            if (remindmeFile == null || remindmeFile == "")
            {//user pressed cancel
                btnImport.selected = false;
                return;
            }
            BLIO.Log("Valid .remindme file selected");

            try
            {
                List <object> toImportReminders = BLReminder.DeserializeRemindersFromFile(remindmeFile).Cast <object>().ToList();


                if (toImportReminders != null)
                {
                    BLIO.Log(toImportReminders.Count - 1 + " reminders in this .remindme file");
                    transferType = ReminderTransferType.IMPORT;

                    foreach (object rem in toImportReminders)
                    {
                        if (rem.GetType() == typeof(Reminder))
                        {
                            BLFormLogic.AddReminderToListview(lvReminders, (Reminder)rem);
                            remindersFromRemindMeFile.Add((Reminder)rem);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageFormManager.MakeMessagePopup("Error loading reminder(s)", 6);
            }
        }
Exemplo n.º 15
0
        private void btnAddFiles_Click(object sender, EventArgs e)
        {
            int           songsAdded = 0;
            List <string> songPaths  = FSManager.Files.GetSelectedFilesWithPath("", "*.mp3; *.wav;").ToList();

            if (songPaths.Count == 1 && songPaths[0] == "")//The user canceled out
            {
                return;
            }

            BLIO.Log("user selected " + songPaths.Count + " mp3 / wav files.");

            List <Songs> songs = new List <Songs>();

            foreach (string songPath in songPaths)
            {
                Songs song = new Songs();
                song.SongFileName = Path.GetFileName(songPath);
                song.SongFilePath = songPath;
                songs.Add(song);
            }
            BLSongs.InsertSongs(songs);
            BLIO.Log("Inserted " + songs.Count + " sound files into RemindME");

            foreach (Songs song in songs)
            {
                if (!ListViewContains(song.SongFilePath))
                {
                    songsAdded++;
                    ListViewItem item = new ListViewItem(song.SongFilePath);
                    item.Tag = song.Id;
                    lvSoundFiles.Items.Add(item);
                }
            }
            MessageFormManager.MakeMessagePopup(songsAdded + " Files added to RemindMe.", 4);

            LoadSongs();
        }
Exemplo n.º 16
0
        private void DownloadMsi()
        {
            new Thread(() =>
            {
                try
                {
                    this.BeginInvoke((MethodInvoker)async delegate
                    {
                        try
                        {
                            BLIO.Log("New version on github! starting download...");
                            updater = new RemindMeUpdater();
                            updater.startDownload();

                            while (!updater.Completed)
                            {
                                await Task.Delay(500);
                            }

                            MessageFormManager.MakeMessagePopup("RemindMe has a new version available to update!\r\nClick the update button on RemindMe on the left panel!", 10);

                            btnNewUpdate.Visible = true;
                            BLIO.Log("Completed downloading the new .msi from github!");
                        }
                        catch
                        {
                            BLIO.Log("Downloading new version of RemindMe failed! :(");
                        }
                    });
                }
                catch (Exception ex)
                {
                    BLIO.Log("Failed downloading MSI. " + ex.ToString());
                }
            }).Start();
        }
Exemplo n.º 17
0
        private void tmrFadeout_Tick(object sender, EventArgs e)
        {
            if (this.Bounds.Contains(MousePosition)) //Cursor in the message? reset opacity to 1 and restart timeout timer
            {
                this.Opacity  = 1;
                secondsPassed = 0;
                tmrTimeout.Start();
            }
            else //Cursor out of the message? safely reduce opacity "slowly"
            {
                this.Opacity -= 0.02;
                if (this.Opacity <= 0)
                {
                    tmrFadeout.Stop();

                    tmrFadein.Dispose();
                    tmrFadeout.Dispose();
                    tmrTimeout.Dispose();
                    BLIO.Log("Message form (" + lblText.Text + ") disposed.");
                    this.Dispose();
                    MessageFormManager.RepositionActivePopups();
                }
            }
        }
Exemplo n.º 18
0
        /// <summary>
        /// Alternative Form_load method since form_load doesnt get called until you first double-click the RemindMe icon due to override SetVisibleCore
        /// </summary>
        private async Task formLoadAsync()
        {
            BLIO.Log("RemindMe_Load");

            BLIO.WriteUpdateBatch(Application.StartupPath);

            lblVersion.Text = "Version " + IOVariables.RemindMeVersion;



            Settings set = BLSettings.GetSettings();

            if (set.LastVersion != null && (new 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";
                    }
                }
                WhatsNew wn = new WhatsNew(set.LastVersion, releaseNotesString);
                wn.Show();

                //Update lastVersion
                set.LastVersion = IOVariables.RemindMeVersion;
                BLSettings.UpdateSettings(set);
            }

            //Default view should be reminders
            pnlMain.Controls.Add(ucReminders);

            MessageFormManager.MakeTodaysRemindersPopup();
            BLIO.Log("Today's reminders popup created");

            //Create an shortcut in the windows startup folder if it doesn't already exist
            if (!File.Exists(IOVariables.startupFolderPath + "\\RemindMe" + ".lnk"))
            {
                FSManager.Shortcuts.CreateShortcut(IOVariables.startupFolderPath, "RemindMe", System.Windows.Forms.Application.StartupPath + "\\" + "RemindMe.exe", "Shortcut of RemindMe");
            }


            if (Debugger.IsAttached)
            {//Debugging ? show extra option
                btnDebugMode.Visible = true;
            }


            BLSongs.InsertWindowsSystemSounds();

            BLIO.Log("RemindMe loaded");
            Cleanup();

            tmrUpdateRemindMe.Start();

            //If the setup still exists, delete it
            File.Delete(IOVariables.rootFolder + "SetupRemindMe.msi");

            //Call the timer once
            Thread tr = new Thread(() =>
            {
                //wait a bit, then call the update timer once. It then runs every 5 minutes
                Thread.Sleep(5000);
                tmrUpdateRemindMe_Tick(null, null);
            });

            tr.Start();


            this.Opacity       = 0;
            this.ShowInTaskbar = true;
            this.Show();
            tmrInitialHide.Start();
        }
Exemplo n.º 19
0
 private void lblExit_Click(object sender, EventArgs e)
 {
     this.Dispose();
     MessageFormManager.RepositionActivePopups();
 }
Exemplo n.º 20
0
        private void tmrCheckReminder_Tick(object sender, EventArgs e)
        {
            if (BLReminder.GetReminders().Where(r => r.Enabled == 1).ToList().Count <= 0)
            {
                tmrCheckReminder.Stop(); //No existing reminders? no enabled reminders? stop timer.
                BLIO.Log("Stopping the reminder checking timer, because there are no more (enabled) reminders");
                return;
            }

            //If a day has passed since the start of RemindMe, we may want to refresh the listview.
            //There might be reminders happening on this day, if so, we show the time of the reminder, instead of the day
            if (dayOfStartRemindMe < DateTime.Now.Day)
            {
                BLIO.Log("Dawn of a new day -24 hours remaining- ");
                UpdateCurrentPage();
                dayOfStartRemindMe = DateTime.Now.Day;
                MessageFormManager.MakeTodaysRemindersPopup();
            }


            //We will check for reminders here every 5 seconds.
            foreach (Reminder rem in BLReminder.GetReminders())
            {
                //Create the popup. Do the other stuff afterwards.
                if ((rem.PostponeDate != null && Convert.ToDateTime(rem.PostponeDate) <= DateTime.Now && rem.Enabled == 1) || (Convert.ToDateTime(rem.Date.Split(',')[0]) <= DateTime.Now && rem.PostponeDate == null && rem.Enabled == 1))
                {
                    //temporarily disable it. When the user postpones the reminder, it will be re-enabled.
                    rem.Enabled = 0;
                    BLReminder.EditReminder(rem);
                    MakeReminderPopup(rem);
                    UpdateCurrentPage();
                }
                else
                {
                    // -- In this part we will create popups at the users right bottom corner of the screen saying x reminder is happening in 1 hour or x minutes -- \\
                    if (BLSettings.IsHourBeforeNotificationEnabled() && rem.Enabled == 1)
                    {
                        DateTime theDateToCheckOn; //Like this we dont need an if ánd an else with the same code
                        if (rem.PostponeDate != null)
                        {
                            theDateToCheckOn = Convert.ToDateTime(rem.PostponeDate);
                        }
                        else
                        {
                            theDateToCheckOn = Convert.ToDateTime(rem.Date.Split(',')[0]);
                        }


                        //The timespan between the date and now.
                        TimeSpan timeSpan = Convert.ToDateTime(theDateToCheckOn) - DateTime.Now;
                        if (timeSpan.TotalMinutes >= 59.50 && timeSpan.TotalMinutes <= 60)
                        {
                            remindersToHappenInAnHour.Add(rem);
                        }
                    }
                }
            }


            string message = "You have " + remindersToHappenInAnHour.Count + " reminders set in 60 minutes:\r\n";
            int    count   = 1;

            foreach (Reminder rem in remindersToHappenInAnHour)
            {
                if (remindersToHappenInAnHour.Count > 1)
                {
                    message += count + ") " + rem.Name + Environment.NewLine;
                }
                else
                {
                    message = rem.Name + " in 60 minutes!";
                }

                count++;
            }

            if (remindersToHappenInAnHour.Count > 1) //cut off the last \n
            {
                message = message.Remove(message.Length - 2, 2);

                if (!popupMessages.Contains(message)) //Don't create this popup if we have already created it once before
                {
                    MessageFormManager.MakeMessagePopup(message, 8);
                }

                popupMessages.Add(message);
            }
            else if (remindersToHappenInAnHour.Count > 0)
            {
                if (!popupMessages.Contains(message)) //Don't create this popup if we have already created it once before
                {
                    MessageFormManager.MakeMessagePopup(message, 8, remindersToHappenInAnHour[0]);
                }

                popupMessages.Add(message);
            }

            remindersToHappenInAnHour.Clear();
        }
Exemplo n.º 21
0
 private void btnConfirm_Click(object sender, EventArgs e)
 {
     BLIO.Log("(AVR) Saving & hiding AVR form");
     MessageFormManager.MakeMessagePopup("Advanced settings applied to this reminder!", 5);
     Hide();
 }
Exemplo n.º 22
0
 private void bunifuFlatButton2_Click(object sender, EventArgs e)
 {
     MessageFormManager.MakeMessagePopup("This is a test.", 4);
 }