Ejemplo n.º 1
0
        private static List <int> ParseReleaseCategory(ITokenList classes)
        {
            var result = new List <int>();

            if (classes.Contains("fa-gamepad"))
            {
                result.Add(TorznabCatType.PCGames.ID);
            }
            else if (classes.Contains("fa-film"))
            {
                result.Add(TorznabCatType.Movies.ID);
            }
            else if (classes.Contains("fa-tv"))
            {
                result.Add(TorznabCatType.TV.ID);
            }
            else if (classes.Contains("fa-microchip"))
            {
                result.Add(TorznabCatType.PC.ID);
            }
            else if (classes.Contains("fa-android"))
            {
                result.Add(TorznabCatType.PCPhoneAndroid.ID);
            }
            return(result);
        }
Ejemplo n.º 2
0
 public static bool Contains(this ITokenList list, string[] tokens)
 {
     for (int i = 0; i < tokens.Length; i++)
     {
         if (!list.Contains(tokens[i]))
         {
             return(false);
         }
     }
     return(true);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns true if the underlying string contains all of the tokens, otherwise false.
        /// </summary>
        /// <param name="list">The list that is considered.</param>
        /// <param name="tokens">The tokens to consider.</param>
        /// <returns>True if the string contained all tokens, otherwise false.</returns>
        public static Boolean Contains(this ITokenList list, String[] tokens)
        {
            for (var i = 0; i < tokens.Length; i++)
            {
                if (!list.Contains(tokens[i]))
                {
                    return(false);
                }
            }

            return(true);
        }