Exemple #1
0
        private WallpaperUpdater InitializeWallpaperUpdater()
        {
            var wallpaperUpdater = new WallpaperUpdater();

            wallpaperUpdater.Update(selectedRssFeed);
            return(wallpaperUpdater);
        }
Exemple #2
0
 public ApplicationConfig()
 {
     rssFeeds        = ReadRssFeedsFromFileOnDisk();
     selectedRssFeed = SelectFirstRssFeedAsDefault();
     trayIcon        = InitializeTrayIcon();
     intervalTimer   = InitializeIntervalTimer();
     SetApplicationExitEventHandler();
     wallpaperUpdater = InitializeWallpaperUpdater();
 }
        private static void Main(string[] args)
        {
            try
            {
                WriteLine("Begin");

                var wallpaperUpdater = new WallpaperUpdater();
                var rssUrl           = ConfigurationManager.AppSettings["rssUrl"];

                wallpaperUpdater.Update(new RssFeed("Default feed", rssUrl));
            }
            catch (Exception ex)
            {
                WriteLine(ex);
                EventLog.WriteEntry("Application", $"WallpaperUpdater failed: {ex}", EventLogEntryType.Information);
            }
            finally
            {
                WriteLine("End");
            }
        }