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;
 }
예제 #2
0
 public void SetTimer(int?secondsToShutdown, Controls.ProgressBarWithText progressBar, ShutdownTimerPicker.ShutdownTimerAction action, PersistentSettings.StartObjects.StartObjectsManager startObjects)
 {
     if (!secondsToShutdown.HasValue)
     {
         shutdownTimer?.Cancel();
         return;
     }
     shutdownTimer = new ShutdownTimer(secondsToShutdown.Value, progressBar, this, action, startObjects);
 }
예제 #3
0
 public StartupObjectsWindow(PersistentSettings.Settings settings, PersistentSettings.StartObjects.StartObjectsManager startObjectsManager)
 {
     Settings             = settings;
     _startObjectsManager = startObjectsManager;
     InitializeComponent();
 }