예제 #1
0
        private void ClickDeleteImage(object sender, RoutedEventArgs e)
        {
            if (view.imageSelection == null || view.imageSelection == "")
            {
                return;
            }
            PersistentData data = new PersistentData(SettingsLoader.GetCurrentSettingsData());

            //dont delete active wallpaper
            if (new Uri(view.imageSelection) == new Uri(Wallpaper.active))
            {
                return;
            }

            for (int i = 0; i < data.imageData.Count; i++)
            {
                if (data.imageData[i].fileName == view.imageSelection)
                {
                    ImageCacheLoader.UnloadImage(data.imageData[i].fileName, (WrapPanel)Scroll.Content);
                    SelectedImageBox.Source = null;
                    PathHandling.DeleteFile(data.imageData[i].fileName);
                    return;
                }
            }
        }
예제 #2
0
        private void InitializeApp()
        {
            Scroll.Content = ImageCacheLoader.LoadImages();

            SettingsLoader.LoadSettingsFromDisk();
            PersistentData currentData = SettingsLoader.GetCurrentSettingsData();

            DisplaySettings(currentData);

            //weather data
            weatherHandler = new WeatherHandler(currentData.openWeatherMapAPIKey, currentData.plz);
            DispatcherTimer LiveTime = new DispatcherTimer();

            UpdateDataPeriodic(this, null); //show immediatly after application start, then start thread
            LiveTime.Interval = TimeSpan.FromSeconds(30);
            LiveTime.Tick    += UpdateDataPeriodic;
            LiveTime.Start();

            FillComboboxes();

            ImageChanger.StartImageCycling(weatherHandler);
        }
예제 #3
0
 private void ClickImportImages(object sender, RoutedEventArgs e)
 {
     PathHandling.ImportFiles();
     Scroll.Content = null;
     Scroll.Content = ImageCacheLoader.LoadImages();
 }