private NuGenAssemblySearchOptions GetSelectedAssemblySearchOptions() { NuGenAssemblySearchOptions result = null; if (assembliesListBox.SelectedIndex > -1) { result = (NuGenAssemblySearchOptions)assembliesListBox.Items[assembliesListBox.SelectedIndex]; } return(result); }
private void assembliesListBox_SelectedIndexChanged(object sender, EventArgs e) { if (!UpdatingControls) { NuGenAssemblySearchOptions selectedAssemblySearchOptions = GetSelectedAssemblySearchOptions(); if (selectedAssemblySearchOptions != null) { DisplayAssemblySearchOptions(GetSelectedAssemblySearchOptions()); } } }
private void DisplayAssemblySearchOptions(NuGenAssemblySearchOptions assemblySearchOptions) { searchOptionsListBox.BeginUpdate(); UpdatingControls = true; for (int index = 0; index < searchOptionsListBox.Items.Count; index++) { SearchOptions searchOption = (SearchOptions)searchOptionsListBox.Items[index]; searchOptionsListBox.SetItemChecked(index, assemblySearchOptions.IsSearchOptionChosen(searchOption)); } UpdatingControls = false; searchOptionsListBox.EndUpdate(); }
private void searchOptionsListBox_ItemCheck(object sender, ItemCheckEventArgs e) { if (!UpdatingControls) { NuGenAssemblySearchOptions selectedAssemblySearchOptions = GetSelectedAssemblySearchOptions(); if (selectedAssemblySearchOptions != null) { SearchOptions selectedSearchOptions = (SearchOptions)searchOptionsListBox.Items[e.Index]; if (e.NewValue == CheckState.Checked) { selectedAssemblySearchOptions.SetSearchOption(selectedSearchOptions); } else { selectedAssemblySearchOptions.ClearSearchOption(selectedSearchOptions); } } } }