Ejemplo n.º 1
0
        private void FilterCombinedTextBox_TextChanged(object sender, EventArgs e)
        {
            if (suppressSearch)
            {
                return;
            }

            try
            {
                currentSearch  = ModSearch.Parse(FilterCombinedTextBox.Text);
                suppressSearch = true;
                SearchDetails.FilterByNameTextBox.Text        = currentSearch?.Name ?? "";
                SearchDetails.FilterByAuthorTextBox.Text      = currentSearch?.Author ?? "";
                SearchDetails.FilterByDescriptionTextBox.Text = currentSearch?.Description ?? "";
                SearchDetails.FilterByLanguageTextBox.Text    = currentSearch?.Localization ?? "";
                SearchDetails.FilterByDependsTextBox.Text     = currentSearch?.DependsOn ?? "";
                SearchDetails.FilterByRecommendsTextBox.Text  = currentSearch?.Recommends ?? "";
                SearchDetails.FilterByConflictsTextBox.Text   = currentSearch?.ConflictsWith ?? "";
                SearchDetails.FilterBySuggestsTextBox.Text    = currentSearch?.Suggests ?? "";
                suppressSearch = false;
                TriggerSearchOrTimer();
            }
            catch (Kraken k)
            {
                Main.Instance.AddStatusMessage(k.Message);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }