private void Steam_AppInfoChanged(AppInfoChangedEventArgs e) { if (InvokeRequired) { Invoke(new MethodInvoker(() => { Steam_AppInfoChanged(e); })); return; } if (lbWatching.Items.Count > 0) { bool doShutdown = lbWatching.Items.Cast <AppInfo>().All(x => !x.IsDownloading); if (doShutdown) { Shutdown(); } } if (e.AppInfo.IsDownloading && !lbUnwatched.Items.Contains(e.AppInfo) && !lbWatching.Items.Contains(e.AppInfo)) { lbUnwatched.Items.Add(e.AppInfo); } else if (AppInfo.CheckDownloading(e.PreviousState) && !e.AppInfo.IsDownloading) { if (lbWatching.Items.Contains(e.AppInfo)) { lbWatching.Items.Remove(e.AppInfo); } else if (lbUnwatched.Items.Contains(e.AppInfo)) { lbUnwatched.Items.Remove(e.AppInfo); } } }
private void Steam_AppInfoChanged(AppInfoChangedEventArgs e) { if (StateMachine.WatchedGames.Count > 0) { bool doShutdown = StateMachine.WatchedGames.All(x => !x.IsDownloading); if (doShutdown) { Shutdown(); } } if (e.AppInfo.IsDownloading && !StateMachine.WatchedGames.Contains(e.AppInfo)) { if (StateMachine.WaitForAll) { StateMachine.WatchedGames.Add(e.AppInfo); } } else if (AppInfo.CheckDownloading(e.PreviousState) && !e.AppInfo.IsDownloading) { StateMachine.WatchedGames.Remove(e.AppInfo); } }