private void AddNamedFiltersForEnum <T>(GAME_TAG key, FilterHasNameFunction <T> hasNameFunction, FilterGetNameFunction <T> getNameFunction)
    {
        IEnumerator enumerator = Enum.GetValues(typeof(T)).GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                T current = (T)enumerator.Current;
                if (hasNameFunction(current))
                {
                    string name = getNameFunction(current);
                    CollectionFilter <GAME_TAG> filter = new CollectionFilter <GAME_TAG>();
                    filter.SetKey(key);
                    filter.SetValue(current);
                    filter.SetFunc(CollectionFilterFunc.EQUAL);
                    this.AddNamedFilter(name, filter);
                }
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable == null)
            {
            }
            disposable.Dispose();
        }
    }
 public void AddGameFilter(GAME_TAG key, object val, CollectionFilterFunc func)
 {
     if (!this.HasGameFilter(key, val, func))
     {
         CollectionFilter <GAME_TAG> item = new CollectionFilter <GAME_TAG>();
         item.SetKey(key);
         item.SetValue(val);
         item.SetFunc(func);
         this.m_gameFilters.Add(item);
     }
 }
 public void AddAccountFilter(ACCOUNT_TAG key, object val, CollectionFilterFunc func)
 {
     if (!this.HasAccountFilter(key, val, func))
     {
         CollectionFilter <ACCOUNT_TAG> item = new CollectionFilter <ACCOUNT_TAG>();
         item.SetKey(key);
         item.SetValue(val);
         item.SetFunc(func);
         this.m_accountFilters.Add(item);
     }
 }
 private void AddNamedFiltersForTags(GAME_TAG[] flaggableKeys, FilterHasNameFunction <GAME_TAG> hasNameFunction, FilterGetNameFunction <GAME_TAG> getNameFunction)
 {
     foreach (GAME_TAG game_tag in flaggableKeys)
     {
         if (hasNameFunction(game_tag))
         {
             string name = getNameFunction(game_tag);
             CollectionFilter <GAME_TAG> filter = new CollectionFilter <GAME_TAG>();
             filter.SetKey(game_tag);
             filter.SetValue(1);
             filter.SetFunc(CollectionFilterFunc.EQUAL);
             this.AddNamedFilter(name, filter);
         }
     }
 }