コード例 #1
0
        private void btn_Send_Click(object sender, EventArgs e)
        {
            if (txt_chat.Text.Trim() == "")
            {
                return;
            }

            if ((txt_chat.Text.Trim().ToLower() == "close") || (txt_chat.Text.Trim().ToLower() == "quit") || (txt_chat.Text.Trim().ToLower() == "exit") || (txt_chat.Text.Trim().ToLower() == "bye"))
            {
                if (MessageBox.Show("Are you sure you want to exit?", "Confirmation", MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
                {
                    if (ga != null)
                    {
                        ga.Stop();
                    }
                    this.Close();
                    Application.Exit();
                    return;
                }
            }


            chat_Display.AppendText(Environment.NewLine + "Me: " + txt_chat.Text + Environment.NewLine);
            chat_Display.ScrollToCaret();
            eduGRID_Thread thread = new eduGRID_Thread(txt_chat.Text);

            ga.StartThread(thread);
        }
コード例 #2
0
        private void ThreadFinished(GThread th)
        {
            // cast GThread back to eduGRID_Thread
            eduGRID_Thread thread = (eduGRID_Thread)th;

            Append_Text("Bot: " + thread.Result);
            //chat_Display.AppendText("Bot: " + thread.Result);

            if (enableSpeechOutputToolStripMenuItem.Checked)
            {
                SpVoice objSpeech = new SpVoice();
                objSpeech.Rate = 1;
                objSpeech.Speak(thread.Result, SpeechVoiceSpeakFlags.SVSFlagsAsync);
                //objSpeech.SynchronousSpeakTimeout = 20;
            }
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: abhishek-kumar/AIGA
        private void btn_Send_Click(object sender, EventArgs e)
        {
            if (txt_chat.Text.Trim() == "")
                return;

            if((txt_chat.Text.Trim().ToLower()=="close")||(txt_chat.Text.Trim().ToLower()=="quit")||(txt_chat.Text.Trim().ToLower()=="exit")||(txt_chat.Text.Trim().ToLower()=="bye"))
            {
                if (MessageBox.Show("Are you sure you want to exit?", "Confirmation", MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
                    {
                        if (ga != null)
                            ga.Stop();
                        this.Close();
                        Application.Exit();
                        return;
                    }
            }

            chat_Display.AppendText(Environment.NewLine + "Me: " + txt_chat.Text + Environment.NewLine);
            chat_Display.ScrollToCaret();
            eduGRID_Thread thread = new eduGRID_Thread(txt_chat.Text);
            ga.StartThread(thread);
        }