private void UpdateConnectionFilter() { CurrentFilterValues.ConnectionMask = new HashSet <int>(); for (int i = 0; i < ConnectionListBox.Items.Count; i++) { if (ConnectionListBox.GetItemChecked(i)) { CurrentFilterValues.ConnectionMask.Add(i); } } }
private void CheckAllConnectionsCheckBox_Click(object sender, System.EventArgs e) { bool bAreAllUnchecked = true; for (int i = 0; i < ConnectionListBox.Items.Count; i++) { if (ConnectionListBox.GetItemChecked(i) == false) { bAreAllUnchecked = false; break; } } for (int i = 0; i < ConnectionListBox.Items.Count; i++) { ConnectionListBox.SetItemChecked(i, !bAreAllUnchecked); } checkAllConnectionsCheckBox.Checked = !bAreAllUnchecked; }