public MainWindow() { InitializeComponent(); Settings = new SettingsWindow(); DatabaseStatements = new DatabaseStatements(); DatabaseStatements.CreateTable(); BarcodeEngineManager.SetBarcodeEngine(Settings.Settings.BarcodeEngine); }
private void LoadBarcodeEngineCombobox() { // set current engine from settings file or set the first engine found if no engine is configured IEnumerable <string> engines = BarcodeEngineManager.GetAllBarcodeEngines().Select(x => x.Identifier); string currentEngine = engines.SingleOrDefault(x => x == Settings.BarcodeEngine); BarcodeEngineComboBox.ItemsSource = engines; if (string.IsNullOrEmpty(currentEngine)) { BarcodeEngineComboBox.SelectedItem = engines.First(); Settings.BarcodeEngine = engines.First(); SaveButton_Click(this, new RoutedEventArgs()); } else { BarcodeEngineComboBox.SelectedItem = currentEngine; } }