Ejemplo n.º 1
0
        private void okButton_Click(object sender, EventArgs e)
        {
            okButton.Enabled = false;

            LocationIQData data = LocationIQService.GetLocationData(inputBox.Text);

            if (data != null)
            {
                JsonConfig.settings.location  = inputBox.Text;
                JsonConfig.settings.latitude  = data.lat;
                JsonConfig.settings.longitude = data.lon;
                JsonConfig.SaveConfig();

                if (Directory.Exists("images"))
                {
                    _wcsService.RunScheduler(true);
                }

                MessageBox.Show("Location set successfully to: " + data.display_name +
                                Environment.NewLine + "(Latitude = " + data.lat + ", Longitude = " + data.lon + ")",
                                "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);

                this.Close();
            }
            else
            {
                MessageBox.Show("The location you entered was invalid, or you are not connected to " +
                                "the Internet.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            okButton.Enabled = true;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public AppContext(string[] args)
        {
            JsonConfig.LoadConfig();
            Localization.Initialize();

            ThemeManager.importPaths = args.Where(System.IO.File.Exists).ToList();
            HandleMultiInstance();

            InitializeTrayIcon();
            LocationManager.Initialize();
            ThemeManager.Initialize();
            wpEngine.RunScheduler();
            LaunchSequence.NextStep();
            UpdateChecker.Initialize();
        }
Ejemplo n.º 4
0
        public AppContext()
        {
            EnforceSingleInstance();

            JsonConfig.LoadConfig();
            InitializeGui();

            ThemeManager.Initialize();
            LocationManager.Initialize();
            wcsService = new WallpaperChangeScheduler();

            if (LocationManager.isReady && ThemeManager.isReady)
            {
                wcsService.RunScheduler();
            }

            UpdateChecker.Initialize();
        }
Ejemplo n.º 5
0
        public AppContext(string[] args)
        {
            // TODO Check tab order on all dialogs
            DebugLogger.WriteLogFile();
            JsonConfig.LoadConfig();
            Localization.Initialize();

            ThemeManager.importPaths = args.Where(System.IO.File.Exists).ToList();
            HandleMultiInstance();

            InitializeTrayIcon();
            LocationManager.Initialize();
            ThemeManager.Initialize();
            ScriptManager.Initialize();

            wpEngine.RunScheduler();
            LaunchSequence.NextStep();
            UpdateChecker.Initialize();
        }
Ejemplo n.º 6
0
        public AppContext(string[] args)
        {
            ThemeManager.importPaths = args.Where(System.IO.File.Exists).ToList();
            HandleMultiInstance();

            JsonConfig.LoadConfig();
            InitializeTrayIcon();

            ThemeManager.Initialize();
            LocationManager.Initialize();
            wpEngine = new WallpaperChangeScheduler();

            if (LocationManager.isReady && ThemeManager.isReady)
            {
                wpEngine.RunScheduler();
            }

            UpdateChecker.Initialize();
        }
Ejemplo n.º 7
0
        public FormWrapper()
        {
            Application.ApplicationExit += new EventHandler(OnApplicationExit);
            EnforceSingleInstance();

            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.RunScheduler();
            }
        }
Ejemplo n.º 8
0
 private void OnRefreshItemClick(object sender, EventArgs e)
 {
     _wcsService.RunScheduler(true);
 }