Esempio n. 1
0
        private void switchNoti_CheckedChanged(object sender, EventArgs e)
        {
            using (var dbContext = new TODOContext())
            {
                us.Noti = switchNoti.Checked;
                dbContext.UserSettings.AddOrUpdate(us);
                dbContext.SaveChanges();
            }

            if (switchNoti.Checked)
            {
                AlertForm af = new AlertForm();
                af.setAlert("Notifications will be displayed here", AlertForm.alertTypeEnum.Info);
            }
        }
Esempio n. 2
0
        public void setAlert(string msg, AlertForm.alertTypeEnum type)
        {
            this.Opacity       = 0.0;
            this.StartPosition = FormStartPosition.Manual;
            string fname;

            for (int i = 1; i < 10; i++)
            {
                fname = "alert" + i.ToString();
                AlertForm f = (AlertForm)Application.OpenForms[fname];

                if (f == null)
                {
                    this.Name     = fname;
                    this.x        = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15;
                    this.y        = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i;
                    this.Location = new Point(this.x, this.y);
                    break;
                }
            }

            this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5;
            switch (type)
            {
            case AlertForm.alertTypeEnum.Warning:
                this.gunaPictureBox1.Image = Resources.Warning_28px;
                this.BackColor             = Color.FromArgb(255, 179, 2);
                break;

            case AlertForm.alertTypeEnum.Info:
                this.gunaPictureBox1.Image = Resources.Info_28px;
                this.BackColor             = Color.FromArgb(71, 169, 248);
                break;
            }
            this.lbText.Text = msg;

            //this.TopMost = false;
            //this.ShowIcon = false;
            //this.ShowInTaskbar = false;

            this.Show();
            this.action          = actionEnum.start;
            this.timer1.Interval = 1;
            this.timer1.Start();
        }
Esempio n. 3
0
        private void switchStartWithWindow_CheckedChanged(object sender, EventArgs e)
        {
            if (switchStartWithWindow.Checked == true)
            {
                AutoStartup.AddApplicationToStartup();
            }
            else
            {
                AutoStartup.RemoveApplicationFromStartup();
            }

            using (var dbContext = new TODOContext())
            {
                us.StartWithWin = switchStartWithWindow.Checked;
                dbContext.UserSettings.AddOrUpdate(us);
                dbContext.SaveChanges();
            }

            if (switchStartWithWindow.Checked)
            {
                AlertForm af = new AlertForm();
                af.setAlert("The application will start with Window", AlertForm.alertTypeEnum.Info);
            }
        }