private void UpdateUI(object sender, EventArgs e)
{
SpeedMonitor.Instance.tick();
// If queue has more than 1 item, check for EmptyQueue control and remove it
if (flowLayoutPanel1.Controls.Count > 1)
{
//foreach (Control control in flowLayoutPanel1.Controls)
//{
if (flowLayoutPanel1.Controls[0] is EmptyQueue)
{
flowLayoutPanel1.Controls.Remove(flowLayoutPanel1.Controls[0]);
//break;
}
//}
}
else if (flowLayoutPanel1.Controls.Count == 0)
{
// Insert EmptyQueue control if queue is empty
flowLayoutPanel1.Controls.Add(new EmptyQueue(this));
}
// Updates Queue and Thread view
foreach (IUpdatingControl control in flowLayoutPanel1.Controls)
{
control.UpdateUI();
}
// Updates speed graph
graphGUI.UpdateUI(SpeedMonitor.Instance.Speed);
//// Append logs
//lock (typeof(Logging))
//{
// foreach (string str in Logging.logList)
// {
// logTextBox.AppendText(str);
// }
// Logging.logList.Clear();
//}
}