public MainWindow()
 {
     PersistentSettings.Settings.InitialiseFile();
     try
     {
         Settings = PersistentSettings.Settings.ReadFromFile();
     }
     catch (System.IO.FileFormatException)
     {
         MessageBox.Show("Settings file was corrupted and will now be reverted to default.", "Start Launcher loading error", MessageBoxButton.OK, MessageBoxImage.Warning);
         Settings = PersistentSettings.Settings.RestoreDefaultSettings();
     }
     _startObjectsManager  = new PersistentSettings.StartObjects.StartObjectsManager(Settings);
     _launchProfileManager = new PersistentSettings.LaunchProfiles.LaunchProfileManager(Settings);
     InitializeComponent();
     SetProfileName();
     SetProfileMenuItems();
     App.CurrentApp.SetTimer(Settings.ShutdownTimerSeconds, ShutdownProgressBar, Settings.ShutdownTimerAction, _startObjectsManager);
     LaunchOnStartup.IsChecked = Settings.LaunchOnStartup;
 }
Example #2
0
        public ShutdownTimerPicker(PersistentSettings.Settings settings)
        {
            ShutdownTimerSeconds = settings.ShutdownTimerSeconds;
            Action = settings.ShutdownTimerAction;
            InitializeComponent();
            Enabled.IsChecked               = ShutdownTimerSeconds.HasValue;
            SecondsToShutdownText.Text      = ShutdownTimerSeconds.HasValue ? ShutdownTimerSeconds.Value.ToString() : "";
            SecondsToShutdownText.IsEnabled = ShutdownTimerSeconds.HasValue;
            switch (Action)
            {
            case ShutdownTimerAction.Quit:
                TimerQuit.IsChecked = true;
                break;

            case ShutdownTimerAction.LaunchAndQuit:
                TimerLaunch.IsChecked = true;
                break;

            default:
                break;
            }
        }
Example #3
0
 public StartupObjectsWindow(PersistentSettings.Settings settings, PersistentSettings.StartObjects.StartObjectsManager startObjectsManager)
 {
     Settings             = settings;
     _startObjectsManager = startObjectsManager;
     InitializeComponent();
 }