private void OnBnClickEditCardboardFormats(object sender, EventArgs e) { try { FormatLoader.EditCardboardFormats(); FillCombo(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void FillCombo() { // fill combo cbCardboardFormat.Items.Clear(); if (null == FormatLoader) { _log.Debug("Format loader is not set! Can not retrieve any cardboard formats!"); return; } cbCardboardFormat.Items.AddRange(FormatLoader.LoadCardboardFormats()); // select first item int selectedIndex = Math.Min(Properties.Settings.Default.ImpositionCarboardFormat, cbCardboardFormat.Items.Count - 1); if (cbCardboardFormat.Items.Count > selectedIndex) { cbCardboardFormat.SelectedIndex = selectedIndex; } }