public void Timer_Elapsed(Object source, ElapsedEventArgs e)
        {
            // Set wallpaper to the image at the current Index
            string path = Path.Combine(_dirPath, _wallpaper.Images[Index].Name);

            if (!File.Exists(path))
            {
                Console.Error.WriteLine($"File doesn't exist: {path}");
            }
            DesktopManager.SetDesktopWallpaper(path);

            // Persist current wallpaper's path via Settings
            Properties.Settings.Default.LastSetWallpaperPath = path;
            Properties.Settings.Default.Save(); // persist settings across application sessions

            // Schedule _timer to run when the sun reaches the next image's progress
            Index = (Index + 1) % _wallpaper.Images.Count; // set Index to next image's index
            DateTime changeTime = SunCalcHelper.GetNextTime(_wallpaper.Images[Index].Progress, DateTime.Now, _location.Latitude, _location.Longitude);
            double   interval   = (changeTime.Ticks - DateTime.Now.Ticks) / TimeSpan.TicksPerMillisecond;

            if (interval < 1)
            {
                interval = 1; // fire timer immediately if it should have fired in the past
            }
            _timer.Interval = interval;
            IsRunning       = true;
            NextChangeTime  = changeTime;
        }
        // Constructor
        public WallpaperScheduler(double lat, double lng)
        {
            // Instantiate properties and instance variables
            _timer           = new Timer();
            _timer.AutoReset = false;
            _timer.Elapsed  += Timer_Elapsed;

            Location = new Location(lat, lng);

            // If current wallpaper's path matches that of last persisted image...
            string current   = DesktopManager.GetDesktopWallpaperPath();
            string persisted = Properties.Settings.Default.LastSetWallpaperPath;

            if (current.Equals(persisted))
            {
                // Set DirPath to persisted image's directory (which initializes our remaining properties and starts the scheduler running)
                DirPath = Path.GetDirectoryName(persisted);
            }
            else
            {
                // Otherwise, call Stop() to set members to indicate we're not running
                Stop();
            }

            // Subscribe to events
            Application.Current.Exit += Application_Exit;
            SystemEvents.TimeChanged += SystemEvents_TimeChanged;
        }