Beispiel #1
0
 private void AddRssFeedsAsMenuItems(TrayIcon trayIcon)
 {
     foreach (var rssFeed in rssFeeds)
     {
         trayIcon.AddMenuItem(rssFeed.Name, new EventHandler(OnNextWallpaper));
     }
 }
Beispiel #2
0
        private TrayIcon InitializeTrayIcon()
        {
            var trayIcon = new TrayIcon("WindowsRedditWallpaperUpdater", Properties.Resources.SystemTrayIcon);

            AddRssFeedsAsMenuItems(trayIcon);
            AddDefaultMenuItems(trayIcon);
            trayIcon.Initialize();
            return(trayIcon);
        }
Beispiel #3
0
 public ApplicationConfig()
 {
     rssFeeds        = ReadRssFeedsFromFileOnDisk();
     selectedRssFeed = SelectFirstRssFeedAsDefault();
     trayIcon        = InitializeTrayIcon();
     intervalTimer   = InitializeIntervalTimer();
     SetApplicationExitEventHandler();
     wallpaperUpdater = InitializeWallpaperUpdater();
 }
Beispiel #4
0
 private void AddDefaultMenuItems(TrayIcon trayIcon)
 {
     trayIcon
     .AddMenuItem("Next Wallpaper", new EventHandler(OnNextWallpaper))
     .AddMenuItem("Exit", new EventHandler(OnExit));
 }