/// /// Copyright (c) 2018 Sensus Slovensko a.s. /// using System; using System.Windows.Forms; namespace TBF.BenchControl.DataEntry { public class DEUtils { /// /// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array /// /// Puchase order ComboBox public static void PrepareCombo(ComboBox comboBox, string[] history, bool emptyOnStart = false) { int historyLen = (history != null) ? history.Length : 0; if (!emptyOnStart && (historyLen > 0)) { comboBox.Text = history[0]; } else { comboBox.Text = string.Empty; } for (int i = 0; i < historyLen; i++) { comboBox.Items.Add(history[i]); } } } }