Example #1
0
        private void StartSorted_Click(object sender, EventArgs e)
        {
            if (Context.array != null)
            {
                if (radioButtonInsertSort.Checked == true)
                {
                    Splash.ShowSplashScreen();
                    form1.Enabled = false;

                    this.context = new Context(new Insert());


                    context.ExecuteAlgorithm(true);
                    this.AddItemsListBox();
                    form1.Enabled = true;
                    Splash.CloseForm();

                    IOFile.SaveData();
                    StartSorted.Enabled = false;
                }
                if (radioButtonRankSorting.Checked == true)
                {
                    Splash.ShowSplashScreen();
                    form1.Enabled = false;

                    this.context = new Context(new RankSorting());
                    context.ExecuteAlgorithm();
                    this.AddItemsListBox();
                    form1.Enabled = true;
                    Splash.CloseForm();

                    IOFile.SaveData();
                    StartSorted.Enabled = false;
                }
                IOFile.Content = "";
            }
            else
            {
                MessageBox.Show("Массив пуст, сортировка невозможна");
            }
        }