Esempio n. 1
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            label2.Visible       = numericUpDown1.Visible = true;
            numericUpDown1.Value = 0;
            button1.Visible      = button2.Visible = TurnaroundTimeLabel.Visible = WaitTimeLabel.Visible = TurnaroundTimeTextBox.Visible = WaitTimeTextBox.Visible = false;
            TurnaroundTimeTextBox.ResetText(); WaitTimeTextBox.ResetText();
            DrawBox.Image = null;

            switch (Enum.Parse(typeof(SortMethod), PrevTemporary.ToString()))
            {
            case SortMethod.FirstComeFirstServeSchedulingSort:
                FirstComeFirstServeScheduling.Remove(Controls);
                break;

            case SortMethod.ShortestRemainingTimeSchedulingSort:
                ShortestRemainingTimeScheduling.Remove(Controls);
                break;

            case SortMethod.PrioritySchedulingSort:
                PriorityScheduling.Remove(Controls);
                break;

            case SortMethod.RoundRobinSchedulingSort:

                break;
            }
        }
Esempio n. 2
0
        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            int count  = (int)numericUpDown1.Value;
            int select = comboBox1.SelectedIndex;

            TurnaroundTimeTextBox.ResetText(); WaitTimeTextBox.ResetText();
            DrawBox.Image = null;
            if (PrevTemporary != select)
            {
                switch (Enum.Parse(typeof(SortMethod), PrevTemporary.ToString()))
                {
                case SortMethod.FirstComeFirstServeSchedulingSort:
                    FirstComeFirstServeScheduling.Remove(Controls);
                    break;

                case SortMethod.ShortestRemainingTimeSchedulingSort:
                    ShortestRemainingTimeScheduling.Remove(Controls);
                    break;

                case SortMethod.PrioritySchedulingSort:
                    PriorityScheduling.Remove(Controls);
                    break;

                case SortMethod.RoundRobinSchedulingSort:

                    break;
                }
            }

            if (count != 0)
            {
                button1.Visible = button2.Visible = TurnaroundTimeLabel.Visible = WaitTimeLabel.Visible = TurnaroundTimeTextBox.Visible = WaitTimeTextBox.Visible = true;
            }
            else
            {
                button1.Visible = button2.Visible = TurnaroundTimeLabel.Visible = WaitTimeLabel.Visible = TurnaroundTimeTextBox.Visible = WaitTimeTextBox.Visible = false;
            }

            switch (Enum.Parse(typeof(SortMethod), select.ToString()))
            {
            case SortMethod.FirstComeFirstServeSchedulingSort:
                FirstComeFirstServeScheduling.Initialize(Controls, count);
                break;

            case SortMethod.ShortestRemainingTimeSchedulingSort:
                ShortestRemainingTimeScheduling.Initialize(Controls, count);
                break;

            case SortMethod.PrioritySchedulingSort:
                PriorityScheduling.Initialize(Controls, count);
                break;

            case SortMethod.RoundRobinSchedulingSort:

                break;
            }

            PrevTemporary = select;
        }