Ejemplo n.º 1
0
        private void Timer_Tick(object sender, EventArgs e)
        {
            if (popupDate <= DateTime.Now)//Let's make the popup
            {
                timer.Stop();

                Reminder rem = new Reminder();
                rem.Date       = popupDate.ToShortDateString() + " " + popupDate.ToShortTimeString();
                rem.RepeatType = ReminderRepeatType.NONE.ToString();
                rem.Id         = -1; //Set it to our "Invalid id" number. It is not a real reminder after all.
                rem.Name       = "Timer";
                rem.Note       = timerText;

                Settings set = BLSettings.GetSettings();
                rem.SoundFilePath = set.DefaultTimerSound;

                Popup pop = new Popup(rem);
                pop.Show();

                //Let's remove this timer. It's served its purpose
                ucTimer.RemoveTimer(this);

                this.Dispose();
            }
        }
Ejemplo n.º 2
0
        private void Timer_Tick(object sender, EventArgs e)
        {
            if (popupDate <= DateTime.Now)//Let's make the popup
            {
                BLIO.Log("Creating timer popup...");

                timer.Stop();

                Reminder rem = new Reminder();
                rem.Date       = popupDate.ToShortDateString() + " " + popupDate.ToShortTimeString();
                rem.RepeatType = ReminderRepeatType.NONE.ToString();
                rem.Id         = -1; //Set it to our "Invalid id" number. It is not a real reminder after all.
                rem.Name       = "Timer";
                rem.Note       = timerText;

                Settings set = BLLocalDatabase.Setting.Settings;
                rem.SoundFilePath = set.DefaultTimerSound;

                if (MaterialForm1.Instance == null)
                {
                    Popup pop = new Popup(rem);
                    pop.Show();
                }
                else
                {
                    MaterialPopup pop = new MaterialPopup(rem);
                    MaterialSkin.MaterialSkinManager.Instance.AddFormToManage(pop);
                    pop.Show();
                }

                //Let's remove this timer. It's served its purpose
                if (ucTimer != null)
                {
                    ucTimer.RemoveTimer(this);
                }
                else
                {
                    mucTimer.RemoveTimer(this);
                }

                this.Dispose();
            }
        }