public void FillingDictionaryStencils() { try { _stencils.Clear(); foreach (var modelDescription in _stencilsProvider.GetModels()) { var country = new CountryItem(modelDescription); foreach (var template in _stencilsProvider.GetStencils(country.ModelId)) { _stencils.Add(new StencilItem(template).StencilId, 0); } } } catch (Exception exc) { Log.Error("Load stencils fail", exc); } }
private void LoadedStencils() { try { _cmbStencils.Items.Clear(); if (_cmbCountries.SelectedItem is CountryItem country && country != CountryItem.Unregistered) { foreach (var stencil in _stencilsProvider.GetStencils(country.ModelId)) { _cmbStencils.Items.Add(new StencilItem(stencil)); } } _cmbStencils.Items.Add(StencilItem.Unregistered); if (_cmbStencils.Items.Count > 0) { _cmbStencils.SelectedIndex = 0; } } catch (Exception exc) when(!exc.IsCritical()) { Log.Error("Load stencils fail.", exc); } }