Пример #1
0
        protected void LoadButton_Click(object sender, System.EventArgs e)
        {
            // Load the Robby character.
            AxAgent.Characters.Load("Robby", (object)"ROBBY.ACS");
            Character        = AxAgent.Characters["Robby"];
            StatusLabel.Text = Character.Name + " loaded.";
            // Set the language to US English.
            Character.LanguageID = 0x409;

            // Display the character.
            Character.Show(null);

            LoadButton.Enabled = false;

            // Display name for the commands.
            Character.Commands.Caption = "Hello World";

            Character.Commands.Add("Hello",                                                        // Command name
                                   (object)"Say Hello",                                            // Display name
                                   (object)"([say](hello | hi) | good (day | morning | evening))", // SR String
                                   (object)true,                                                   // Enabled
                                   (object)true);                                                  // Visible

            Character.Commands.Add("Goodbye",                                                      // Command name
                                   (object)"Goodbye",                                              // Display name
                                   (object)"(bye | goodbye | exit | close | quit)",                // SR String
                                   (object)true,                                                   // Enabled
                                   (object)true);                                                  // Visible

            PromptLabel.Visible = true;
        }
Пример #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     for (int i = 0; i < strAgents.Length; i++)               //循環深度搜尋
     {
         listBox1.Items.Add(strAgents[i]);                    //向控制元件listBox1中新增字串陣列中的內容
     }
     ICR  = axAgent1.Characters.Load("merlin", "merlin.acs"); //載入指定文件
     ICCE = axAgent1.Characters.Character("merlin");          //設定模擬Office助手的表情
     ICCE.Show(0);                                            //顯示模擬Office助手錶情
 }
Пример #3
0
 private void Form1_Load(object sender, EventArgs e)
 {
     for (int i = 0; i < strAgents.Length; i++)               //循环遍历
     {
         listBox1.Items.Add(strAgents[i]);                    //向控件listBox1中添加字符串数组中的内容
     }
     ICR  = axAgent1.Characters.Load("merlin", "merlin.acs"); //加载指定文件
     ICCE = axAgent1.Characters.Character("merlin");          //设定模拟Office助手的表情
     ICCE.Show(0);                                            //显示模拟Office助手表情
 }
Пример #4
0
 private void Form1_Load(object sender, EventArgs e)
 {
     for (int i = 0; i < strAgents.Length; i++)//循环遍历
     {
         listBox1.Items.Add(strAgents[i]);//向控件listBox1中添加字符串数组中的内容
     }
     ICR = axAgent1.Characters.Load("merlin", "merlin.acs");//加载指定文件
     ICCE = axAgent1.Characters.Character("merlin");//设定模拟Office助手的表情
     ICCE.Show(0);//显示模拟Office助手表情
 }
Пример #5
0
        protected void ShowButton_Click(object sender, System.EventArgs e)
        {
            // Load the Genie character.
            AxAgent.Characters.Load("Genie", (object)"GENIE.ACS");
            Character        = AxAgent.Characters["Genie"];
            StatusLabel.Text = Character.Name + " loaded.";
            // Set the language to US English.
            Character.LanguageID = 0x409;

            // Display the character.
            Character.Show(null);

            ShowButton.Enabled  = false;
            SpeakButton.Enabled = true;
            TextToSpeak.Enabled = true;

            this.AcceptButton = SpeakButton;
        }
Пример #6
0
        protected void LoadButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.AddExtension     = true;
            openFileDialog.Filter           = "Microsoft Agent Characters (*.acs)|*.acs";
            openFileDialog.FilterIndex      = 1;
            openFileDialog.RestoreDirectory = true;

            if (openFileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            try { AxAgent.Characters.Unload("CharacterID"); }
            catch { }
            AxAgent.Characters.Load("CharacterID", (object)openFileDialog.FileName);
            Character            = AxAgent.Characters["CharacterID"];
            StatusLabel.Text     = Character.Name + " loaded.";
            Character.LanguageID = 0x409;

            AnimationList.Items.Clear();
            foreach (String sAnim in Character.AnimationNames)
            {
                AnimationList.Items.Add((object)sAnim);
            }

            this.AcceptButton = PlayButton;

            Character.Show(null);

            PosX.Text = Character.Left.ToString();
            PosY.Text = Character.Top.ToString();

            BalloonCheck.Checked  = ((Character.Balloon.Style & BalloonOn) != 0);
            AutoHideCheck.Checked = ((Character.Balloon.Style & AutoHide) != 0);
            AutoPaceCheck.Checked = ((Character.Balloon.Style & AutoPace) != 0);
            AutoSizeCheck.Checked = ((Character.Balloon.Style & SizeToText) != 0);

            SoundsCheck.Checked = AxAgent.AudioOutput.SoundEffects;

            BalloonCheck.Enabled  = Character.Balloon.Enabled;
            AutoHideCheck.Enabled = Character.Balloon.Enabled;
            AutoPaceCheck.Enabled = Character.Balloon.Enabled;
            AutoSizeCheck.Enabled = Character.Balloon.Enabled;

            if (Character.Balloon.Enabled)
            {
                Character.Balloon.FontName = "Tahoma";
                Character.Balloon.FontSize = 8;
            }

            PosX.Enabled       = true;
            PosY.Enabled       = true;
            MoveButton.Enabled = true;

            TextToSpeak.Enabled = true;
            SpeakButton.Enabled = true;

            PlayButton.Enabled = true;
            StopButton.Enabled = true;

            AutoStopCheck.Enabled = true;
            SoundsCheck.Enabled   = true;

            Character.Commands.RemoveAll();
            Character.Commands.Add("CharacterOptions",
                                   (object)"&Options...", null, null, null);
        }