예제 #1
0
        private void testButtonClick(object sender, RoutedEventArgs e)
        {
            if (!SpeechService.Instance.eddiSpeaking)
            {
                ScriptRecoveryService.SaveRecoveryScript(ScriptValue,
                                                         ScriptName,
                                                         ScriptDescription,
                                                         Responder,
                                                         Priority,
                                                         _script.defaultValue);

                // Splice the new script in to the existing scripts
                ScriptValue = scriptView.Text;
                Dictionary <string, Script> newScripts = new Dictionary <string, Script>(_scripts);
                Script testScript = new Script(ScriptName, ScriptDescription, false, ScriptValue);
                newScripts.Remove(ScriptName);
                newScripts.Add(ScriptName, testScript);

                SpeechResponder speechResponder = new SpeechResponder();
                speechResponder.Start();
                speechResponder.TestScript(ScriptName, newScripts);
            }
            else
            {
                SpeechService.Instance.ShutUp();
            }
        }
예제 #2
0
 private void testScript(object sender, RoutedEventArgs e)
 {
     if (!SpeechService.Instance.eddiSpeaking)
     {
         Script          script    = ((KeyValuePair <string, Script>)((Button)e.Source).DataContext).Value;
         SpeechResponder responder = new SpeechResponder();
         responder.Start();
         responder.TestScript(script.Name, Personality.Scripts);
     }
     else
     {
         SpeechService.Instance.ShutUp();
     }
 }