Esempio n. 1
0
 private void cmdGrabar_Click(object sender, EventArgs e)
 {
     if ((tbVar.Text != "") && (tbValor.Text != ""))
     {
         mCfg.SetKeyValue("appSettings", tbVar.Text, tbValor.Text);
         mCfg.Save();
         dgVar.Rows[dgVar_RowIndex].Cells[0].Value = tbVar.Text;
         dgVar.Rows[dgVar_RowIndex].Cells[1].Value = tbValor.Text;
         tbVar.Text   = "";
         tbValor.Text = "";
     }
 }
Esempio n. 2
0
        private void cmdGrabar_Click(object sender, EventArgs e)
        {
            string salida = "";

            foreach (string s in lstSeleccion.Items)
            {
                salida = salida + "," + s;
            }
            if (salida != "")
            {
                salida = salida.Substring(1);
            }

            if (salida.Trim() == "")
            {
                MessageBox.Show("Debe asignar algún valor");
                return;
            }
            else
            {
                m_mCfg.SetKeyValue("appSettings", m_Modo, salida);
                Cursor.Current = Cursors.WaitCursor;
                m_mCfg.Save();
                m_frmCfg.CargarConfiguracion();
                Cursor.Current = Cursors.Default;
            }
            m_frmCfg.Enabled = true;
            this.Dispose();
        }
Esempio n. 3
0
        private void Grabar_Click(object sender, EventArgs e)
        {
            string valor = "";

            if (tbClave.Text != "")
            {
                Cursor = Cursors.WaitCursor;
                foreach (string v in lstMacro.Items)
                {
                    if (valor != "")
                    {
                        valor += "|";
                    }
                    valor += v;
                }
                if (valor.Trim() == "")
                {
                    MessageBox.Show("La macro a ejecutar debe contener algún comando");
                    return;
                }

                mCfg.SetKeyValue(Gramatica + Idioma, tbClave.Text, tbComandoVoz.Text);
                mCfg.SetKeyValue(Gramatica + Idioma, "SeccionValores", Gramatica + "Valores");
                mCfg.SetKeyValue(Gramatica + "Valores", tbClave.Text, valor);

                if (tbAyuda.Text != "")
                {
                    mCfg.SetKeyValue(Gramatica + "Ayuda" + Idioma, tbClave.Text, tbAyuda.Text);
                    mCfg.SetKeyValue(Gramatica + Idioma, "SeccionAyuda", Gramatica + "Ayuda" + Idioma);
                }
                else
                {
                    mCfg.cfgDeleteKey(Gramatica + "Ayuda" + Idioma, tbClave.Text);
                }

                if (tbPrecision.Text != "")
                {
                    //Recuperamos el identificador de comandos con precisión individual
                    //Comprobamos que la clave actual se encuentra dentro, sino la introducimos
                    mCfg.SetKeyValue(Gramatica + "Precision" + Idioma, tbClave.Text, tbPrecision.Text);
                    mCfg.SetKeyValue(Gramatica + Idioma, "SeccionPrecision", Gramatica + "Precision" + Idioma);
                }
                else
                {
                    mCfg.cfgDeleteKey(Gramatica + "Precision" + Idioma, tbClave.Text);
                }

                mCfg.Save();
                //frmCfg.CargarConfiguracion();
                frmCfg.CargarGramatica();
                frmCfg.Enabled = true;
                Cursor         = Cursors.Default;
                this.Dispose();
            }
        }