private void selectTimerLabel(int keyId) { switch (keyId) { case 0: ServerForm.ourRed(); break; case 1: ServerForm.ourBlue(); break; case 2: ServerForm.theirRed(); break; case 3: ServerForm.theirBlue(); break; case 4: ServerForm.drake(); break; case 5: ServerForm.baron(); break; default: break; } }
public ServerForm() { InitializeComponent(); thisForm = this; timerLabels = new Label[6] { OurBlueT, OurRedT, TheirBlueT, TheirRedT, DrakeT, BaronT }; thisForm.or = new System.Threading.Timer(new TimerCallback(orCallBack), null, Timeout.Infinite, Timeout.Infinite); thisForm.ob = new System.Threading.Timer(new TimerCallback(obCallBack), null, Timeout.Infinite, Timeout.Infinite); thisForm.tr = new System.Threading.Timer(new TimerCallback(trCallBack), null, Timeout.Infinite, Timeout.Infinite); thisForm.tb = new System.Threading.Timer(new TimerCallback(tbCallBack), null, Timeout.Infinite, Timeout.Infinite); thisForm.drakeTimer = new System.Threading.Timer(new TimerCallback(drakeCallBack), null, Timeout.Infinite, Timeout.Infinite); thisForm.baronTimer = new System.Threading.Timer(new TimerCallback(baronCallBack), null, Timeout.Infinite, Timeout.Infinite); }