Example #1
0
        private void populateComboBoxes(Backend backend)
        {
            Dictionary <string, string> shopItems = backend.getShopItems();

            comboBox1.DataSource    = new BindingSource(shopItems, null);
            comboBox1.DisplayMember = "Value";
            comboBox1.ValueMember   = "Key";

            comboBox2.DataSource    = new BindingSource(shopItems, null);
            comboBox2.DisplayMember = "Value";
            comboBox2.ValueMember   = "Key";

            comboBox3.DataSource    = new BindingSource(shopItems, null);
            comboBox3.DisplayMember = "Value";
            comboBox3.ValueMember   = "Key";

            comboBox4.DataSource    = new BindingSource(shopItems, null);
            comboBox4.DisplayMember = "Value";
            comboBox4.ValueMember   = "Key";

            comboBox5.DataSource    = new BindingSource(shopItems, null);
            comboBox5.DisplayMember = "Value";
            comboBox5.ValueMember   = "Key";

            comboBox6.DataSource    = new BindingSource(shopItems, null);
            comboBox6.DisplayMember = "Value";
            comboBox6.ValueMember   = "Key";

            comboBox7.DataSource    = new BindingSource(shopItems, null);
            comboBox7.DisplayMember = "Value";
            comboBox7.ValueMember   = "Key";

            comboBox8.DataSource    = new BindingSource(shopItems, null);
            comboBox8.DisplayMember = "Value";
            comboBox8.ValueMember   = "Key";

            comboBox9.DataSource    = new BindingSource(shopItems, null);
            comboBox9.DisplayMember = "Value";
            comboBox9.ValueMember   = "Key";

            comboBox10.DataSource    = new BindingSource(shopItems, null);
            comboBox10.DisplayMember = "Value";
            comboBox10.ValueMember   = "Key";

            comboBox11.DataSource    = new BindingSource(shopItems, null);
            comboBox11.DisplayMember = "Value";
            comboBox11.ValueMember   = "Key";

            comboBox12.DataSource    = new BindingSource(shopItems, null);
            comboBox12.DisplayMember = "Value";
            comboBox12.ValueMember   = "Key";

            comboBox13.DataSource    = new BindingSource(shopItems, null);
            comboBox13.DisplayMember = "Value";
            comboBox13.ValueMember   = "Key";

            comboBox14.DataSource    = new BindingSource(shopItems, null);
            comboBox14.DisplayMember = "Value";
            comboBox14.ValueMember   = "Key";

            comboBox15.DataSource    = new BindingSource(shopItems, null);
            comboBox15.DisplayMember = "Value";
            comboBox15.ValueMember   = "Key";

            comboBox16.DataSource    = new BindingSource(shopItems, null);
            comboBox16.DisplayMember = "Value";
            comboBox16.ValueMember   = "Key";
        }