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 FillingStencilsGrid(CountryItem country) { foreach (var value in _stencils) { if (country == null) { _dgvStensils.Rows.Add(value.Key, value.Value); } else { foreach (var template in _stencilsProvider.GetStencils(country.ModelId)) { var stencil = new StencilItem(template).StencilId; if (!value.Key.Equals(stencil)) { continue; } _dgvStensils.Rows.Add(value.Key, value.Value); } } } }