private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex == (int)schedulerTypes.RoundRobbin)
     {
         EnterValueForm pop = new EnterValueForm("Enter quantum for Round Robbin:", EnterValueForm.PopUpType.Input);
         if (pop.ShowDialog() == DialogResult.OK)
         {
             value        = pop.value;
             scheduler    = (schedulerTypes)comboBox1.SelectedIndex;
             DialogResult = DialogResult.OK;
         }
         else
         {
             comboBox1.SelectedItem = null;
         }
     }
     else if (comboBox1.SelectedIndex == (int)schedulerTypes.FirstComeFirstServe)
     {
         scheduler    = (schedulerTypes)comboBox1.SelectedIndex;
         DialogResult = DialogResult.OK;
     }
     else if (comboBox1.SelectedIndex == (int)schedulerTypes.HightstResponseRatioNext)
     {
         scheduler    = (schedulerTypes)comboBox1.SelectedIndex;
         DialogResult = DialogResult.OK;
     }
     else if (comboBox1.SelectedIndex == (int)schedulerTypes.EarliestDeadlineFirst)
     {
         EnterValueForm pop = new EnterValueForm("Max deadline is arrival time + burst time + ", EnterValueForm.PopUpType.Input);
         if (pop.ShowDialog() == DialogResult.OK)
         {
             value        = pop.value;
             scheduler    = (schedulerTypes)comboBox1.SelectedIndex;
             DialogResult = DialogResult.OK;
         }
         else
         {
             comboBox1.SelectedItem = null;
         }
     }
     else if (comboBox1.SelectedIndex == (int)schedulerTypes.MultilevelFeedbackQueue)
     {
         AddMLFQForm pop = new AddMLFQForm();
         if (pop.ShowDialog() == DialogResult.OK)
         {
             sch          = pop.queues;
             scheduler    = (schedulerTypes)comboBox1.SelectedIndex;
             DialogResult = DialogResult.OK;
         }
         else
         {
             comboBox1.SelectedItem = null;
         }
     }
     else if (comboBox1.SelectedIndex == (int)schedulerTypes.ShortestJobFirst)
     {
         scheduler    = (schedulerTypes)comboBox1.SelectedIndex;
         DialogResult = DialogResult.OK;
     }
 }
        private void buttonSetMLFQ_Click(object sender, EventArgs e)
        {
            AddMLFQForm pop = new AddMLFQForm();

            if (pop.ShowDialog() == DialogResult.OK)
            {
                string name = "MLFQ-" + pop.queues[0].name + "-" + pop.queues[1].name + "-" + pop.queues[2].name;
                List <MultiLevelableScheduler> list = new List <MultiLevelableScheduler>();
                listBoxMLFQ.Items.Clear();
                for (int i = 0; i < 3; i++)
                {
                    list.Add(pop.queues[i]);
                    listBoxMLFQ.Items.Add(pop.queues[i].name);
                }
                Scheduler tempScheduler = new MultiLevelFeedbackQueueScheduler(name, list, FIFO, LRU);
                simulationManager.schedulers.Clear();
                simulationManager.schedulers.Add(tempScheduler);
            }
            else
            {
                //do nothing
            }
        }