Пример #1
0
        private void loadFiltersIntoUI()
        {
            availableFilters.Clear();
            filterList.Items.Clear();
            filterList.Items.Add("All servers");
            filterList.Items.Add("Favourites");
            filterList.Items.Add("Friends");

            availableFilters.Add(Filter.getDefaultFilter());

            // Favourites filter
            Filter temp = Filter.getDefaultFilter();

            temp.Favourites = Filter.YNA.Yes;
            availableFilters.Add(temp);

            temp         = Filter.getDefaultFilter();
            temp.Friends = Filter.YNA.Yes;
            availableFilters.Add(temp);

            try
            {
                foreach (string f in Directory.GetFiles("filters/", "*.osl", SearchOption.TopDirectoryOnly))
                {
                    string fn = Path.GetFileNameWithoutExtension(f);
                    Filter f2 = FilterLoader.LoadFilterClass(fn);
                    availableFilters.Add(f2);
                    filterList.Items.Add(f2.filterName);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Error while loading filters! " + e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }
 public serverBrowserForm()
 {
     InitializeComponent();
     currentFilter = Filter.getDefaultFilter();
     serverList    = new List <Server>();
     infoDlg       = new InfoDlg(new doUpdateServer(refreshSingleServer), new JoiningCallback(onJoiningGame));
     filtersDlg    = new FiltersDlg(new onFilterChanged(filterChanged));
     favMngr       = new FavouritesMngr();
     friendMngr    = new FriendsMngr();
 }
Пример #3
0
 private void newFilter_Click(object sender, EventArgs e)
 {
     new FilterCreateDlg(Filter.getDefaultFilter(), filterUpdated, true).ShowDialog();
 }