public IEnumerator <object> PopulateGroups(long categoryFilter, int selectedGroupID) { CategoryFilter = categoryFilter; Groups.BeginUpdate(); Groups.Items.Clear(); Groups.Sorted = false; object selectedItem = "<All Items>"; Groups.Items.Add(selectedItem); using (var q = Program.Database.BuildQuery( "SELECT groupID, name FROM evedata.groups WHERE categoryID = ?" )) using (var e = q.Execute <GroupEntry>(categoryFilter)) while (!e.Disposed) { yield return(e.Fetch()); foreach (var item in e) { Groups.Items.Add(item); if (selectedGroupID == item.ID) { selectedItem = item; } } } Groups.Sorted = true; Groups.SelectedItem = selectedItem; Groups.EndUpdate(); }
private void GroupsAddButton_Click(object sender, EventArgs e) { Groups.BeginUpdate(); var newItem = Groups.Items.Add($"New Group{newGroupNo}"); newGroupNo++; Groups.EndUpdate(); Groups.SelectedItem = Groups.Items[newItem]; }
private void GroupsAddButton_Click(object sender, EventArgs e) { Groups.BeginUpdate(); int newItem = Groups.Items.Add($"newgroup{newGroupNo}"); Groups.EndUpdate(); groupList.Add(new Group { name = $"newgroup{newGroupNo}", badge = $"newgroup{newGroupNo}", badgeColour = "default", badgeCover = false, badgeHidden = false, kickPower = 0, requiredKickPower = 0, KickingAndShortTermBanning = false, BanningUpToDay = false, LongTermBanning = false, ForceclassSelf = false, ForceclassToSpectator = false, ForceclassWithoutRestrictions = false, GivingItems = false, WarheadEvents = false, RespawnEvents = false, RoundEvents = false, SetGroup = false, GameplayData = false, Overwatch = false, FacilityManagement = false, PlayersManagement = false, PermissionsManagement = false, ServerConsoleCommands = false, ViewHiddenBadges = false, ServerConfigs = false, Broadcasting = false, PlayerSensitiveDataAccess = false, Noclip = false, AFKImmunity = false }); groupNameList.Add($"newgroup{newGroupNo}"); newGroupNo++; Groups.SelectedItem = Groups.Items[newItem]; }