HasCategoriesExcept() public method

Check to see if the game has any categories set that do not exist in the given list
public HasCategoriesExcept ( ICollection except ) : bool
except ICollection List of games to exclude from the check
return bool
Example #1
0
 /// <summary>
 /// Checks to see if a game should currently be displayed, based on the state of the category list.
 /// </summary>
 /// <param name="g">Game to check</param>
 /// <returns>True if it should be displayed, false otherwise</returns>
 bool ShouldDisplayGame( GameInfo g )
 {
     if( !gameData.Games.ContainsKey( g.Id ) ) {
         return false;
     }
     if( lstCategories.SelectedItem == null ) {
         return false;
     }
     if( lstCategories.SelectedItem is string ) {
         if( (string)lstCategories.SelectedItem == GlobalStrings.MainForm_All ) {
             return true;
         }
         if( (string)lstCategories.SelectedItem == GlobalStrings.MainForm_Uncategorized ) {
             return !g.HasCategoriesExcept( gameData.FavoriteCategory );
         }
     } else if( lstCategories.SelectedItem is Category ) {
         return g.ContainsCategory( lstCategories.SelectedItem as Category );
     }
     return false;
 }