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 onSelect(ComboBox combobox, int i) { if (combobox.SelectedIndex == (int)schedulerTypes.RoundRobbin) { EnterValueForm pop = new EnterValueForm("Enter quantum for Round Robbin:", EnterValueForm.PopUpType.Input); if (pop.ShowDialog() == DialogResult.OK) { queues[i] = new RoundRobinScheduler("RR:" + pop.value, pop.value, null); } else { combobox.SelectedItem = null; } } else if (combobox.SelectedIndex == (int)schedulerTypes.FirstComeFirstServe) { queues[i] = new FirstComeFirstServeScheduler("FCFS", null); } }