Exemple #1
0
        private void filterOptionsButton_Click(object sender, RoutedEventArgs e)
        {
            //TODO preventing multiple Windows
            FilterOptionsWindow filterWindow = new FilterOptionsWindow();

            FilterOptionsWindow.fillFilterBox(filterWindow);

            filterWindow.Show();
        }
Exemple #2
0
        /// <summary>
        /// gives back the selected Value from the filterbox
        /// </summary>
        /// <param name="filterWindow"></param>
        /// <returns></returns>
        public static string giveBackFilterBox(FilterOptionsWindow filterWindow)
        {
            ListBoxItem X = (ListBoxItem)filterWindow.filterBox.SelectedValue;

            if (X != null)
            {
                return(X.Content.ToString());
            }
            else
            {
                return("");
            }
        }
Exemple #3
0
        /// <summary>
        /// Collects all mods you found, to show them in your filter
        /// </summary>
        /// <param name="filterWindow"></param>
        public static void fillFilterBox(FilterOptionsWindow filterWindow)
        {
            Stashes.getAbsolutelyAllMods();
            filterWindow.filterBox.Items.Clear();

            foreach (string mod in Stashes.absolutelyAllMods)
            {
                if (filterWindow.searchFilterTxtBox.Text == "" || mod.ToLower().Contains(filterWindow.searchFilterTxtBox.Text.ToLower()))
                {
                    ListBoxItem item = new ListBoxItem();
                    item.Content = mod;
                    filterWindow.filterBox.Items.Add(item);
                }
            }
        }