private void Thread_ProgressChanged(object sender, ProgressChangedEventArgs e) { ArrayList arrReturnValue = DebugMessages.Instance.FlushMessages(); foreach (string strLine in arrReturnValue) { if (strLine.StartsWith(MainSM.GetEntityName((int)EntityName.ent_Miner_Bob))) { txtUpdates.SelectionColor = mColourBob; } else if (strLine.StartsWith(MainSM.GetEntityName((int)EntityName.ent_Elsa))) { txtUpdates.SelectionColor = mColourElsa; } else if (strLine.StartsWith(MainSM.GetEntityName((int)EntityName.ent_BarFly))) { txtUpdates.SelectionColor = mColourBarFly; } else { txtUpdates.SelectionColor = Color.Black; } txtUpdates.AppendText(strLine + Environment.NewLine); } if (e.ProgressPercentage == 100) { txtUpdates.SelectionColor = Color.Black; txtUpdates.AppendText(Environment.NewLine + "Demo Complete!" + Environment.NewLine); } else { lblLocationBob.Text = MainSM.GetLocation((int)Bob.Location); lblStatusBob.Text = Bob.GetFSM().CurrentState.GetType().Name.ToString(); lblLocationWife.Text = MainSM.GetLocation((int)Elsa.Location); lblStatusWife.Text = Elsa.GetFSM().CurrentState.GetType().Name.ToString(); lblLocationBarFly.Text = MainSM.GetLocation((int)Joe.Location); lblStatusBarFly.Text = Joe.GetFSM().CurrentState.GetType().Name.ToString(); } }