void cmdBorrarElementoLista_Confirmacion(string respuesta, Confirmacion frm) { if (frm.respuesta == "SI") { if (tbTexto.Text != "") { if (cbListaSustitucion.Text != "") { Cursor = Cursors.WaitCursor; mCfg.cfgDeleteKey(cbListaSustitucion.Text, tbTexto.Text); mCfg.Save(); RecargarListaSubstitucion(); Cursor = Cursors.Default; } } } frm.Dispose(); }
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(); } }