Beispiel #1
0
        private void AutoCheckBox_Unchecked(object sender, RoutedEventArgs e)
        {
            if (e != null)
            {
                taskSchHandler.RemoveAllTasks();
                if (Settings.Default.LogonTaskInsteadOfAutostart)
                {
                    taskSchHandler.RemoveLogonTask();
                }
                else
                {
                    regEditHandler.RemoveAutoStart();
                }
            }

            StackPanelRadioHolder.IsEnabled  = false;
            RadioButtonCustomTimes.IsChecked = true;
            DisableLocationMode();
            applyButton.IsEnabled          = false;
            darkStartBox.IsEnabled         = false;
            DarkStartMinutesBox.IsEnabled  = false;
            lightStartBox.IsEnabled        = false;
            LightStartMinutesBox.IsEnabled = false;
            userFeedback.Text        = Properties.Resources.welcomeText; //Activate the checkbox to enable automatic theme switching
            Settings.Default.Enabled = false;
        }
        private void CheckBoxLogonTask_Click(object sender, RoutedEventArgs e)
        {
            RegeditHandler regeditHandler = new RegeditHandler();
            TaskSchHandler taskScheduler  = new TaskSchHandler();

            if (CheckBoxLogonTask.IsChecked.Value)
            {
                regeditHandler.RemoveAutoStart();
                taskScheduler.CreateLogonTask();
                Settings.Default.LogonTaskInsteadOfAutostart = true;
            }
            else
            {
                taskScheduler.RemoveLogonTask();
                regeditHandler.AddAutoStart();
                Settings.Default.LogonTaskInsteadOfAutostart = false;
            }
        }