Esempio n. 1
0
        /// <summary>
        /// Creates a new instance of popup
        /// </summary>
        private void MakeReminderPopup(Reminder rem)
        {
            MaterialPopup p = new MaterialPopup(rem);

            MaterialSkin.MaterialSkinManager.Instance.AddFormToManage(p);
            p.Show();
        }
Esempio n. 2
0
        private void btnTest_Click(object sender, EventArgs e)
        {
            BLIO.Log("(MUCResizePopup)btnAddReminder_Click");
            if (testPop == null || testPop.IsDisposed)
            {
                testPop = new MaterialPopup(testrem); //create a new instance
                MaterialSkin.MaterialSkinManager.Instance.AddFormToManage(testPop);
                testPop.MaximumSize = new Size(int.MaxValue, int.MaxValue);
                testPop.Width       = (int)trbWidth.Value;
                testPop.Height      = (int)trbHeight.Value;

                testPop.Show();              //show the new instance.
            }

            if (!testPop.Visible)
            {
                testPop.Show();
                testPop.Visible = true;
            }
            else
            {
                ApplyPreviewChanges();
            }

            refreshTrackbars();
        }
        private async void PreviewReminder(int delay = 0)
        {
            //Set the reminder first, so that switching pages doesn't preview a different reminder.
            Reminder previewRem = CopyReminder(rem);

            if (delay > 0)
            {
                await Task.Delay(delay);
            }

            if (previewRem == null)
            {
                BLIO.Log("Reminder in PreviewReminder() is null. Interesting... ;)");
                MaterialMessageFormManager.MakeMessagePopup("Could not preview that reminder. It doesn't exist anymore!", 4, "Error");
                return;
            }

            BLIO.Log("Previewing reminder with id " + previewRem.Id);
            previewRem.Id = -1; //give the >temporary< reminder an invalid id, so that the real reminder won't be altered

            MaterialPopup p = new MaterialPopup(previewRem);

            MaterialSkin.MaterialSkinManager.Instance.AddFormToManage(p);
            p.TopMost  = true;
            p.TopLevel = true;
            p.Show();

            new Thread(() =>
            {
                //Log an entry to the database, for data!
                try
                {
                    try
                    {
                        BLOnlineDatabase.PreviewCount++;
                    }
                    catch (ArgumentException ex)
                    {
                        BLIO.Log("Exception at BLOnlineDatabase.PreviewCount++. -> " + ex.Message);
                        BLIO.WriteError(ex, ex.Message, true);
                    }
                    finally
                    {
                        GC.Collect();
                    }
                }
                catch (ArgumentException ex)
                {
                    BLIO.Log("Exception at BLOnlineDatabase.PreviewCount++. -> " + ex.Message);
                    BLIO.WriteError(ex, ex.Message, true);
                }
            }).Start();

            this.Invalidate();
            this.Refresh();
        }