public Form_Main() { InitializeComponent(); comboBoxPriceType.SelectedItem = comboBoxPriceType.Items[0]; comboBoxCompanySize.SelectedItem = comboBoxCompanySize.Items[0]; comboBoxCity.SelectedItem = comboBoxCity.Items[0]; #region рубрики foreach (Dictionary <string, string> table in Rubrics.data()) { listBoxRubrics.Items.Add(table["Каталог рубрик"]); CheckedListBox rubric = new CheckedListBox(); rubric.Size = new Size(336, 202); rubric.Location = new Point(7, 161); rubric.BorderStyle = System.Windows.Forms.BorderStyle.None; rubric.CheckOnClick = true; rubric.Name = (string)table["Каталог рубрик"]; rubric.Visible = false; foreach (KeyValuePair <string, string> entry in table) { rubric.Items.Add(entry.Key); } rubric.Items.Remove("Каталог рубрик"); rubric.ItemCheck += checkRubricBox_ItemCheck; tabPage2.Controls.Add(rubric); } #endregion }
static Rubrics() { int i = 0; hashRubrics = new Dictionary <int, string>(); foreach (Dictionary <string, string> table in Rubrics.data()) { foreach (KeyValuePair <string, string> entry in table) { if (entry.Key != "Каталог рубрик") { hashRubrics.Add(i, entry.Value); i++; } } } }