Esempio n. 1
0
        public void ModificarModo(string Modo, List <string> Gram, List <string> Seleccion, IntPtr Handle, ConfigXml mCfg, Configuracion Cfg)
        {
            m_frmCfg         = Cfg;
            m_mCfg           = mCfg;
            m_Modo           = Modo;
            m_frmCfg.Enabled = false;
            List <string> SelGram = new List <string>();

            Gramaticas    = Gram;
            GramSeleccion = Seleccion;
            CargarGramaticas(Gram, Seleccion);
            this.Show();
        }
Esempio n. 2
0
        public void ActivarBuscarComandos()
        {
            dgComandos.Rows.Clear();
            dgGramaticas.Rows.Clear();
            tbComando.Text = "";
            string fic;

            // Usar el path del ejecutable
            fic = Application.StartupPath + @"\XULIA.exe.config";
            // La clase debemos instanciarla indicando el path a usar
            // y opcionalmente si se guarda cada vez que se asigne un valor.
            mCfg = new ConfigXml(fic, true);

            //REcuperamos la información de idioma
            Idioma = mCfg.GetValue("appSettings", "IdiomaGramaticas");
            //Recuperamos la información de configuración
            StringCollection secciones = mCfg.Secciones();

            //Cargamos el combobox de gramáticas
            foreach (string s in secciones)
            {
                if ((Strings.InStr(s, "Valores") == 0) &&
                    (Strings.InStr(s, "Precision") == 0) &&
                    (Strings.InStr(s, "Ayuda") == 0) &&
                    (Strings.Right(s, Idioma.Length) == Idioma))
                {
                    string gram = s.Substring(0, s.Length - Idioma.Length);
                    lstGramaticas.Items.Add(gram);
                }
            }
            //Recuperamos la información de MODOS
            Hashtable h = mCfg.Claves("appSettings");

            string[] aVar = new string[2];

            //ICollection ckeys;
            //ckeys = h.Keys;
            foreach (DictionaryEntry entry in h)
            {
                string var = entry.Key.ToString();
                if ((var.Substring(0, 1) == "·") || (var.Substring(0, 1) == "$"))
                { //Modos de operación
                    if (Strings.InStr(var, "·SUSTITUCIONES·") == 0)
                    {
                        lstModos.Items.Add(entry.Key.ToString());
                    }
                }
            }
            this.Show();
            AIMLGUI.ProcesamientoComandos.SiempreEncima((int)this.Handle);
        }
Esempio n. 3
0
        public void Editar(string Gram, string clave, string comandovoz, string precision, string ayuda, string macro, List <Configuracion.CommandHelp> ListaComandos, ConfigXml Cfg, string pIdioma, Configuracion frmConfig)
        {
            Comandos    = ListaComandos;
            Gramatica   = Gram;
            mCfg        = Cfg;
            Idioma      = pIdioma;
            m_precision = precision;
            m_ayuda     = ayuda;
            m_clave     = clave;
            frmCfg      = frmConfig;

            frmCfg.Enabled = false;

            tbClave.Text = clave;
            if (clave == "")
            {
                tbClave.Enabled = true;
            }
            tbComandoVoz.Text = comandovoz;
            tbPrecision.Text  = precision;
            tbAyuda.Text      = ayuda;
            string[] comandos = macro.Split('|');
            for (int i = 0; i < comandos.Length; i++)
            {
                if (comandos[i] != "")
                {
                    lstMacro.Items.Add(comandos[i]);
                }
            }

            foreach (Configuracion.CommandHelp c in ListaComandos)
            {
                cbComandos.Items.Add(c.Comando);
            }

            this.Show();
        }
Esempio n. 4
0
        public void CargarConfiguracion()
        {
            dgVar.Rows.Clear();
            dgModos.Rows.Clear();
            dgListaSustitucion.Rows.Clear();
            dgGramaticas.Rows.Clear();
            cbListaSustitucion.Items.Clear();
            cbGramaticas.Items.Clear();

            string fic;

            // Usar el path del ejecutable
            fic = Application.StartupPath + @"\XULIA.exe.config";
            // La clase debemos instanciarla indicando el path a usar
            // y opcionalmente si se guarda cada vez que se asigne un valor.
            mCfg = new ConfigXml(fic, true);

            //REcuperamos la información de idioma
            Idioma = mCfg.GetValue("appSettings", "IdiomaGramaticas");
            //Recuperamos la información de configuración
            Hashtable h = mCfg.Claves("appSettings");

            string[] aVar = new string[2];

            //ICollection ckeys;
            //ckeys = h.Keys;
            foreach (DictionaryEntry entry in h)
            {
                string var = entry.Key.ToString();
                if ((var.Substring(0, 1) == "·") || (var.Substring(0, 1) == "$"))
                { //Modos de operación
                    if (Strings.InStr(var, "·SUSTITUCIONES·") > 0)
                    {
                        cbListaSustitucion.Items.Add(entry.Value.ToString());
                    }
                    else if (Strings.Right(var, Idioma.Length) == Idioma)
                    {
                        aVar[0] = entry.Key.ToString();
                        aVar[1] = entry.Value.ToString();
                        dgModos.Rows.Add(aVar);
                    }
                }
                else
                { //Variables
                    if (Strings.Right(var, Idioma.Length) == Idioma)
                    {
                        aVar[0] = entry.Key.ToString();
                        aVar[1] = entry.Value.ToString();
                        dgVar.Rows.Add(aVar);
                    }
                }
            }
            StringCollection secciones = mCfg.Secciones();

            //Cargamos el combobox de gramáticas
            foreach (string s in secciones)
            {
                if ((Strings.InStr(s, "Valores") == 0) &&
                    (Strings.InStr(s, "Precision") == 0) &&
                    (Strings.InStr(s, "Ayuda") == 0) &&
                    (Strings.Right(s, Idioma.Length) == Idioma))
                {
                    string gram = s.Substring(0, s.Length - Idioma.Length);
                    cbGramaticas.Items.Add(gram);
                }
            }
            CargarComandos();
        }