Курсовая работа: Подсистема управления процессами
case 4: return ThreadPriority.Highest;
default: return ThreadPriority.Normal;
}
}
private void button1_Click(object sender, EventArgs e)
{
BetaProc process;
switch (processType.SelectedButton)
{
case 0: process = new FibbonProc();
break;
case 1: process = new ProcRandom();
break;
case 2: process = new SinProc();
break;
default: process = new ProcRandom();
break;
}
process.SwaitTostart = wh1;
process.reporter = richTextBox1;
process.reporterD = dataGridView1;
process.Start();
process.Prior = IndexToPriority(processPriority.SelectedButton);
manager.AddThread(process);
manager.ShowInDataView(process);
process.WorkingStateChanged += new EventHandler(a_WorkingStateChanged);
// расчётпроцессорноноговремени
if (process.Prior > HighestPriority) HighestPriority = process.Prior;
ProcessPriorities[index] = process.Prior;