private void playShowSound2() { EmoticionsPictureBox.BackgroundImage = Resources.NotListening; lastState = TaskPanelState.NotListining; EmoticionsPictureBox.Refresh(); Stream str = Properties.Resources.UI_button_2; System.Media.SoundPlayer snd = new System.Media.SoundPlayer(str); snd.Play(); }
public void openTests() { if (this.InvokeRequired) { this.BeginInvoke((MethodInvoker) delegate { openTests(); }); return; } TestProcesor tp = new TestProcesor(); tp.Show(); EnableAnimation(false); EmoticionsPictureBox.BackgroundImage = Resources.NotListening; lastState = TaskPanelState.NotListining; EmoticionsPictureBox.Refresh(); }
public void TaskPanelUpdate() { if (EmoticionsPictureBox.InvokeRequired) { EmoticionsPictureBox.BeginInvoke((MethodInvoker) delegate { if (lastState != state) { EmoticionsPictureBox.BackgroundImage = null; EmoticionsPictureBox.Invalidate(); switch (state) { case TaskPanelState.Smiling: EmoticionsPictureBox.BackgroundImage = Resources.smile; lastState = TaskPanelState.Smiling; EmoticionsPictureBox.Refresh(); break; case TaskPanelState.Speaking: EmoticionsPictureBox.BackgroundImage = Resources.Speaking; lastState = TaskPanelState.Speaking; EmoticionsPictureBox.Refresh(); break; case TaskPanelState.IDK: if (lastGeneratedTime < Time.time) { allIDK = new List <Bitmap>() { Resources.frown, Resources.meh }; int index = random.Next(allIDK.Count); var name = allIDK[index]; EmoticionsPictureBox.BackgroundImage = name; lastGeneratedTime = Time.time + 60; lastState = TaskPanelState.IDK; EmoticionsPictureBox.Refresh(); } break; case TaskPanelState.Exiting: EmoticionsPictureBox.BackgroundImage = Resources.Exiting; lastState = TaskPanelState.Exiting; EmoticionsPictureBox.Refresh(); break; case TaskPanelState.NotListining: EmoticionsPictureBox.BackgroundImage = Resources.NotListening; lastState = TaskPanelState.NotListining; EmoticionsPictureBox.Refresh(); break; case TaskPanelState.Listening: EmoticionsPictureBox.BackgroundImage = Resources.Listening; lastState = TaskPanelState.Listening; EmoticionsPictureBox.Refresh(); break; case TaskPanelState.Pusseling: EmoticionsPictureBox.BackgroundImage = Resources.idu0; lastState = TaskPanelState.Pusseling; EmoticionsPictureBox.Refresh(); break; } } }); } if (this.InvokeRequired) { BeginInvoke((MethodInvoker) delegate { if (isclosing) { if (timeOut < Time.time) { new JAnimate().FadeOutForm(this, 1, new Action(() => { isclosing = false; })); } } }); return; } try { new JAnimate().FadeOutForm(this, 1); } catch { } }