private void SetIcon() { Icon icon; string suffix; if (_jobManager.Any()) { bool areJobsRunning; bool didJobsFail; areJobsRunning = _jobManager.GetJobs().Any(j => j.InProgress); didJobsFail = _jobManager.GetJobs().Any(j => j.Failed); icon = areJobsRunning ? Resources.SmallDownloadIcon : didJobsFail ? Resources.SmallErrorIcon : Resources.SmallIcon; suffix = areJobsRunning ? " - Downloading changes" : _jobManager.GetJobs().Any(j => j.IsComplete) ? " - Up to date" : string.Empty; } else { icon = Resources.SmallQueryIcon; suffix = " - No jobs defined"; } this.TrayIcon.Icon = icon; this.TrayIcon.Text = string.Concat(Application.ProductName, suffix); }