コード例 #1
0
ファイル: Form1.cs プロジェクト: jonkaz1/EyeTracker
 private void HideActionLabels()
 {
     Action1Label.Invoke((MethodInvoker)(() =>
     {
         Action1Label.Hide();
         Action2Label.Hide();
         Action3Label.Hide();
     }));
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: jonkaz1/EyeTracker
        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();
                }));
            }
        }