private void SetupDefaultSearch() { var def = configuration.DefaultSearches; if (def == null || def.Count < 1) { // Fall back to old setting ManageMods.Filter(ModList.FilterToSavedSearch( (GUIModFilter)configuration.ActiveFilter, ManageMods.mainModList.ModuleTags.Tags.GetOrDefault(configuration.TagFilter), ManageMods.mainModList.ModuleLabels.LabelsFor(CurrentInstance.Name) .FirstOrDefault(l => l.Name == configuration.CustomLabelFilter) )); // Clear the old filter so it doesn't get pulled forward again configuration.ActiveFilter = (int)GUIModFilter.All; } else { var labels = ManageMods.mainModList.ModuleLabels.LabelsFor(CurrentInstance.Name).ToList(); var searches = def.Select(s => ModSearch.Parse(s, labels)).ToList(); ManageMods.SetSearches(searches); } }
private void LabelLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { var link = sender as LinkLabel; OnChangeFilter?.Invoke(ModList.FilterToSavedSearch(GUIModFilter.CustomLabel, null, link.Tag as ModuleLabel)); }