private void AddRssFeedsAsMenuItems(TrayIcon trayIcon) { foreach (var rssFeed in rssFeeds) { trayIcon.AddMenuItem(rssFeed.Name, new EventHandler(OnNextWallpaper)); } }
private TrayIcon InitializeTrayIcon() { var trayIcon = new TrayIcon("WindowsRedditWallpaperUpdater", Properties.Resources.SystemTrayIcon); AddRssFeedsAsMenuItems(trayIcon); AddDefaultMenuItems(trayIcon); trayIcon.Initialize(); return(trayIcon); }
public ApplicationConfig() { rssFeeds = ReadRssFeedsFromFileOnDisk(); selectedRssFeed = SelectFirstRssFeedAsDefault(); trayIcon = InitializeTrayIcon(); intervalTimer = InitializeIntervalTimer(); SetApplicationExitEventHandler(); wallpaperUpdater = InitializeWallpaperUpdater(); }
private void AddDefaultMenuItems(TrayIcon trayIcon) { trayIcon .AddMenuItem("Next Wallpaper", new EventHandler(OnNextWallpaper)) .AddMenuItem("Exit", new EventHandler(OnExit)); }