Пример #1
0
        public MaterialTimerPopup()
        {
            MaterialSkin.MaterialSkinManager.Instance.AddFormToManage(this);

            InitializeComponent();

            instance     = this;
            this.Opacity = 0;

            //Set the location within the remindme window.
            //This prompt can be moved, but inititally will be set to the middle of the location of RemindMe
            MaterialForm1 remindme = (MaterialForm1)Application.OpenForms["MaterialForm1"];

            if (remindme != null && remindme.Visible)
            {
                this.StartPosition = FormStartPosition.Manual;
                this.Location      = new Point(remindme.Location.X + ((remindme.Width / 2) - this.Width / 2), remindme.Location.Y + ((remindme.Height / 2) - (this.Height / 2)));
            }
            else
            {
                this.StartPosition = FormStartPosition.CenterScreen;
            }

            tmrFadeIn.Start();
            tbTime.KeyUp += TimerPopup_KeyUp;
            tbNote.KeyUp += TimerPopup_KeyUp;
            this.KeyUp   += TimerPopup_KeyUp;

            tbTime.KeyDown  += numericOnly_KeyDown;
            tbTime.KeyPress += numericOnly_KeyPress;

            this.MaximumSize = this.Size;
            this.MinimumSize = this.Size;

            this.TopMost = true;
            this.BringToFront();
            this.Focus();
            this.ActiveControl = tbTime;

            if (!this.Focused)
            {
                this.Activate();
            }

            BLIO.Log("TimerPopup created");
        }
Пример #2
0
        private void MaterialAdvancedReminderForm_Load(object sender, EventArgs e)
        {
            BLIO.Log("Advanced Reminder Form loaded");
            MaterialForm1 remindme = (MaterialForm1)Application.OpenForms["MaterialForm1"];

            if (remindme != null)
            {
                //Place the message box in the middle of remindme
                this.StartPosition = FormStartPosition.Manual;
                this.Location      = new Point(remindme.Location.X + ((remindme.Width / 2) - this.Width / 2), remindme.Location.Y + ((remindme.Height / 2) - (this.Height / 2)));
            }
            else
            {
                this.StartPosition = FormStartPosition.CenterScreen;
            }

            tmrFadeIn.Start();
        }
Пример #3
0
        public MaterialForm1()
        {
            BLIO.Log("===  Initializing RemindMe Version " + IOVariables.RemindMeVersion + "  ===");
            BLIO.CreateSettings();
            AppDomain.CurrentDomain.SetData("DataDirectory", IOVariables.databaseFile);

            int  tries = 0;
            bool done  = false;

            while (!done || !BLLocalDatabase.HasAllTables())
            {
                try
                {
                    tries++;
                    if (tries >= 4 || BLLocalDatabase.HasAllTables())
                    {
                        done = true;
                        if (tries >= 4)
                        {
                            BLIO.Log("something went terribly wrong... 4 tries and it still doesnt work..");
                        }
                    }

                    BLIO.Log("DB does not have all tables. Entered while loop to create.");
                    BLIO.CreateDatabaseIfNotExist();
                    Thread.Sleep(500);
                }
                catch (Exception ex)
                {
                }
            }

            LogWindowsInfo(); //Windows version info etc
            LogCultureInfo(); //Datetime info in their country
            Cleanup();



            this.Opacity = 0;
            InitializeComponent();

            // Initialize MaterialSkinManager
            materialSkinManager = MaterialSkinManager.Instance;
            materialSkinManager.ThemeChanged += UpdateTheme;
            materialSkinManager.AddFormToManage(this);

            instance = this;

            m_GlobalHook          = Hook.GlobalEvents();
            m_GlobalHook.KeyDown += GlobalKeyPressDown;
            m_GlobalHook.KeyUp   += GlobalKeyPressUp;

            //Set the Renderer of the menustrip to our custom renderer, which sets the highlight and border collor to DimGray, which is the same
            //As the menu's themselves, which means you will not see any highlighting color or border. This renderer also makes the text of the selected
            //toolstrip items white.
            RemindMeTrayIconMenuStrip.Renderer = new MyToolStripMenuRenderer();


            UpdateInformation.Initialize();

            //dont show debug



            formLoad();

            SystemEvents.PowerModeChanged += OnPowerChange;

            RemindMeIcon.Visible = true;

            //Update LastOnline every 5 minutes
            tmrPingActivity.Start();

            tmrDumpLogTxtContents.Start();

            tmrEnableDatabaseAccess.Start();


            //workaround
            tmrRemoveDebug.Start();
            tmrResetExceptionInserts.Start();

            this.MaximumSize = this.Size;
            this.MinimumSize = this.Size;

            BLIO.Log("===  Initializing RemindMe Complete  ===");
        }
        private MaterialRemindMeBox(string description, RemindMeBoxReason buttons, bool showDontRemindOption)
        {
            BLIO.Log("Constructing RemindMeBox(" + description + "");
            //We will use the default "Attention" title text
            InitializeComponent();
            AddFont(Properties.Resources.Roboto_Medium);

            showDontRemind = showDontRemindOption;

            if (buttons == RemindMeBoxReason.YesNo)
            {
                btnYes.Visible = true;
                btnNo.Visible  = true;
            }
            else
            {
                btnOk.Visible = true;
            }

            if (showDontRemind)
            {
                pnlRemind.Visible = true;
            }

            this.description = description;

            this.Opacity = 0;
            tmrFadeIn.Start();
            lblText.MaximumSize = new Size((pnlMainGradient.Width - lblText.Location.X) - 10, 0);


            lblText.Text = description;



            MaterialForm1 remindme = (MaterialForm1)Application.OpenForms["MaterialForm1"];

            if (remindme != null && remindme.Visible)
            {
                //Place the message box in the middle of remindme
                this.StartPosition = FormStartPosition.Manual;
                this.Location      = new Point(remindme.Location.X + ((remindme.Width / 2) - this.Width / 2), remindme.Location.Y + ((remindme.Height / 2) - (this.Height / 2)));
            }
            else
            {
                this.StartPosition = FormStartPosition.CenterScreen;
            }

            lblText.LinkColor       = MaterialSkin.MaterialSkinManager.Instance.ColorScheme.AccentColor;
            lblText.ActiveLinkColor = MaterialSkin.MaterialSkinManager.Instance.ColorScheme.LightPrimaryColor;

            string timers = "Click here to convert these Timers into Reminders and close RemindMe";

            if (lblText.Text.EndsWith(timers))
            {
                lblText.Links.Add(lblText.Text.IndexOf(timers), timers.Length);
                lblText.LinkClicked += (s, ee) => { ImportRemindersFromTimers(); };
            }

            BLIO.Log("RemindMeBox constructed");
        }