public void ShowInFavoriteSearchFilters()
        {
            if (SavedSearchFilters.GetRootInstanceID() == 0)
            {
                SavedSearchFilters.AddInitializedListener(ShowInFavoriteSearchFilters);
                return;
            }

            SavedSearchFilters.RemoveInitializedListener(ShowInFavoriteSearchFilters);
            int prevInstanceID = 0;

            foreach (var filter in filters)
            {
                int instanceID = SavedSearchFilters.GetFilterInstanceID(filter[0], filter[1]);
                if (instanceID == 0)
                {
                    SearchFilter searchFilter = SearchFilter.CreateSearchFilterFromString(filter[1]);
                    if (prevInstanceID == 0)
                    {
                        prevInstanceID = SavedSearchFilters.AddSavedFilter(filter[0], searchFilter, 64);
                    }
                    else
                    {
                        prevInstanceID = SavedSearchFilters.AddSavedFilterAfterInstanceID(filter[0], searchFilter, 64, prevInstanceID, false);
                    }
                }
            }

            SavedSearchFilters.RefreshSavedFilters();

            foreach (ProjectBrowser pb in ProjectBrowser.GetAllProjectBrowsers())
            {
                pb.Repaint();
            }
        }
Example #2
0
 public void ShowInFavoriteSearchFilters()
 {
     if (SavedSearchFilters.GetRootInstanceID() == 0)
     {
         SavedSearchFilters.AddInitializedListener(new Action(this.ShowInFavoriteSearchFilters));
     }
     else
     {
         SavedSearchFilters.RemoveInitializedListener(new Action(this.ShowInFavoriteSearchFilters));
         int num = 0;
         foreach (string[] current in this.filters)
         {
             if (SavedSearchFilters.GetFilterInstanceID(current[0], current[1]) == 0)
             {
                 SearchFilter filter = SearchFilter.CreateSearchFilterFromString(current[1]);
                 if (num == 0)
                 {
                     num = SavedSearchFilters.AddSavedFilter(current[0], filter, 64f);
                 }
                 else
                 {
                     num = SavedSearchFilters.AddSavedFilterAfterInstanceID(current[0], filter, 64f, num, false);
                 }
             }
         }
         SavedSearchFilters.RefreshSavedFilters();
         foreach (ProjectBrowser current2 in ProjectBrowser.GetAllProjectBrowsers())
         {
             current2.Repaint();
         }
     }
 }
Example #3
0
 public void HideFromFavoriteSearchFilters()
 {
     SavedSearchFilters.RefreshSavedFilters();
     foreach (ProjectBrowser current in ProjectBrowser.GetAllProjectBrowsers())
     {
         current.Repaint();
     }
 }