private void HideActionLabels() { Action1Label.Invoke((MethodInvoker)(() => { Action1Label.Hide(); Action2Label.Hide(); Action3Label.Hide(); })); }
private void AddInput(int eyeState) { if (commandWasDisplayed) { HideActionLabels(); HideExecutedCommandLabel(); commandWasDisplayed = false; } inputs.Add(eyeState); if (inputs.Count == 1) { string key = EyeStates.FirstOrDefault(x => x.Value == eyeState).Key; Action1Label.Invoke((MethodInvoker)(() => { Action1Label.Text = key; Action1Label.Show(); })); } else if (inputs.Count == 2) { string key = EyeStates.FirstOrDefault(x => x.Value == eyeState).Key; Action2Label.Invoke((MethodInvoker)(() => { Action2Label.Text = key; Action2Label.Show(); })); } else if (inputs.Count == 3) { string key = EyeStates.FirstOrDefault(x => x.Value == eyeState).Key; Action3Label.Invoke((MethodInvoker)(() => { Action3Label.Text = key; Action3Label.Show(); })); } }