Example #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);
            }
        }
Example #2
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);
            }
        }