如果我以具有正在运行的 System.Windows.Forms.Timer 的表单从我的 Winforms 应用程序调用 Application.Exit,那么计时器也会自动停止吗?
public void StartProcessing()
{
int i = 0;
while (true)
{
if (BatchNumbersQueue.Count > 0)
{
i = BatchNumbersQueue[0];
}
else
{
//stop the time that queues batches and exit
timer1.Stop();
Application.Exit();
}
ProcessQueue();
QueueOfBatches.RemoveBatchToQueue(i);
i = 0;
}
}
//timer tick event
private void timer1_Tick(object sender, EventArgs e)
{
UpdateProcessingQueue();
}