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();
        }
    }
 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);
         }
     }
 }