public FormWrapper() { Application.ApplicationExit += new EventHandler(OnApplicationExit); EnforceSingleInstance(); SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(OnPowerModeChanged); JsonConfig.LoadConfig(); _wcsService = new WallpaperChangeScheduler(); InitializeComponent(); _startupManager = UwpDesktop.GetStartupManager(notifyIcon.ContextMenu.MenuItems[6]); if (!Directory.Exists("images")) { DownloadImages(); } else if (JsonConfig.firstRun) { UpdateLocation(); } else { _wcsService.StartScheduler(); } }
public AppContext() { EnforceSingleInstance(); JsonConfig.LoadConfig(); InitializeComponent(); _startupManager = UwpDesktop.GetStartupManager(notifyIcon.ContextMenu.MenuItems[6]); _wcsService = new WallpaperChangeScheduler(); if (!Directory.Exists("images")) { DownloadImages(); } else if (JsonConfig.settings.location == null) { UpdateLocation(); } else { _wcsService.RunScheduler(); } UpdateChecker.Initialize(notifyIcon); }