コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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);
        }