Exemple #1
0
        private async void button2_Click(object sender, EventArgs e)
        {
            this.comboBoxListDiscipline.SelectedIndexChanged += new EventHandler(comboboxListDiscipline_SelectedIndexChanged);

            await Task.Factory.StartNew(() =>
            {
                InvokeUI(() =>
                {
                    var _listGroup = WorkWithDB.GetListGroupForDiscipline(DisciplineName).AsParallel();
                    if (WorkWithDB.GetListGroupForDiscipline(DisciplineName) != null)
                    {
                        AddItemToComboBox(comboBoxListGroups, _listGroup);
                    }
                    else
                    {
                        MessageBox.Show("Таких групп нет!");
                    }
                    _listGroup.ToList().Clear();
                });
            });
        }