public Form1(String defaultGameVersion, List <String> gameVersions, bool checkUpdates) { unitDatabase = UnitDatabasePool.getUnitDatabasePool().getUnitDatabase(this, defaultGameVersion); InitializeComponent(); versionDropdown.DataSource = gameVersions; versionDropdown.SelectedItem = defaultGameVersion; countrySelect.DataSource = unitDatabase.getAllCountries(); List <String> categories = new List <String>(unitDatabase.categories); categories.Sort(); categories.Insert(0, ALL); categorySelect.DataSource = categories; autoUpdate = checkUpdates; // Manually register these handlers beause their execution order is important unitList.SelectedIndexChanged += unitList_SelectedIndexChanged; weaponDropdownSimple.SelectedIndexChanged += weaponDropdownSimple_SelectedIndexChanged; weaponDropdown.SelectedIndexChanged += weaponDropdown_SelectedIndexChanged; customQueryInput.TextChanged += customQueryInput_TextChanged; }
private void versionDropdown_SelectedIndexChanged(object sender, EventArgs e) { unitDatabase = UnitDatabasePool.getUnitDatabasePool().getUnitDatabase(this, versionDropdown.GetItemText(versionDropdown.SelectedItem)); }