コード例 #1
0
ファイル: Interfaz.xaml.cs プロジェクト: Dangeros78/IAStark
 private void btnAjustes_Click(object sender, RoutedEventArgs e)
 {
     if (Ajustes == null)
     {
         Ajustes = new Ajustes();
         Ajustes.Show();
         Ajustes.Closed += delegate(object a, EventArgs b)
         {
             Ajustes = null;
         };
     }
 }
コード例 #2
0
ファイル: Interfaz.xaml.cs プロジェクト: Dangeros78/IAStark
        private void usuario_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            start.recogResult = e.Result;
            start.speech      = e.Result.Text;
            Activo(start.speech);

            if (Settings.Default.On_Off_Micro == true)
            {
                if (e.Result.Confidence >= Settings.Default.ConfidenciaUsuario)
                {
                    if (start.habilitarReconocimiento == true)
                    {
                        string ejecutarcmdBD       = gramaticas.EjecutarComandosBD(start.speech); // ay que reparlo
                        string ejecutarcmdInternos = gramaticas.SinonimoCmd(start.speech);
                        string calculadora         = gramaticas.Calc(start.recogResult);
                        string buscador            = gramaticas.Busc(start.recogResult, start.speech);
                        if (ejecutarcmdBD != string.Empty)
                        {
                            start.asistente.SpeakAsync(ejecutarcmdBD + "          ."); // ay que reparlo
                        }
                        if (ejecutarcmdInternos != string.Empty)
                        {
                            if (ejecutarcmdInternos == "Abriendo configuraciones del sistema")
                            {
                                if (Ajustes == null)
                                {
                                    Ajustes = new Ajustes();
                                    Ajustes.Show();
                                    Ajustes.Closed += delegate(object a, EventArgs b)
                                    {
                                        Ajustes = null;
                                    };
                                }
                            }
                            else if (ejecutarcmdInternos == "Abriendo el editor de comandos")
                            {
                                EditorCmd cmd = new EditorCmd();
                                cmd.Show();
                            }
                            else if (ejecutarcmdInternos == "Hasta pronto")
                            {
                                start.asistente.Speak(ejecutarcmdInternos + Properties.Settings.Default.NombreUsuario);
                                Application.Current.Shutdown();
                            }
                            else if (ejecutarcmdInternos == "Minimizado")
                            {
                                Visibility = Visibility.Hidden;
                            }
                            else if (ejecutarcmdInternos == "Mostrado")
                            {
                                Visibility = Visibility.Visible;
                            }
                            else if (ejecutarcmdInternos == "Mostrando todos los comandos")
                            {
                                csis = new ComandosSistema();
                                csis.Show();
                            }
                            start.asistente.SpeakAsync(ejecutarcmdInternos + "         .");
                        }
                        if (calculadora != string.Empty)
                        {
                            start.asistente.SpeakAsync(calculadora + "         .");
                        }
                        if (buscador != string.Empty)
                        {
                            start.asistente.SpeakAsync(buscador + "          .");
                        }
                    }
                }
            }
        }