public void CargarGramatica(string gramatica, DataGridView dgGramaticas, string filtro) { //Recuperamos la información de configuración string Seccion = gramatica + Idioma; string SeccionValores = ""; bool SecPrecision = false; Hashtable h = mCfg.Claves(Seccion); Hashtable hAyuda = new Hashtable(); Hashtable hPrecision = new Hashtable(); Hashtable hValores = new Hashtable(); bool SecAyuda = false; float Precision = 0; //ICollection ckeys; //ckeys = h.Keys; if (h.Count == 0) { return; } SeccionValores = h["SeccionValores"].ToString(); hValores = mCfg.Claves(SeccionValores); if (h.Contains("SeccionAyuda")) { SecAyuda = true; hAyuda = mCfg.Claves(h["SeccionAyuda"].ToString()); } if (h.Contains("SeccionPrecision")) { SecPrecision = true; hPrecision = mCfg.Claves(h["SeccionPrecision"].ToString()); } if (h.Contains("ValorPrecision")) { Precision = Convert.ToInt16(h["ValorPrecision"].ToString()) / 100; } foreach (DictionaryEntry entry in h) { string sClave = ""; string sComandoVoz = ""; string sAyuda = ""; string sMacro = ""; string[] row = new string[4]; if ((entry.Key.ToString() != "SeccionValores") && (entry.Key.ToString() != "SeccionAyuda") && (entry.Key.ToString() != "SeccionPrecision")) { sClave = entry.Key.ToString(); sComandoVoz = entry.Value.ToString(); sAyuda = mCfg.RecuperarValorSeccion(hAyuda, sClave, SecAyuda); if (SeccionValores != "") { sMacro = hValores[entry.Key.ToString()].ToString(); } row[0] = sComandoVoz; row[1] = sAyuda; row[2] = gramatica; row[3] = sMacro; if (sClave != "") { if (Strings.InStr(sComandoVoz, filtro) > 0) { dgGramaticas.Rows.Add(row); } } } } }
public void CargarGramatica() { if (cbGramaticas.SelectedIndex != -1) { //Recuperamos la información de configuración string Seccion = cbGramaticas.Items[cbGramaticas.SelectedIndex].ToString() + Idioma; string SeccionValores = ""; Hashtable h = mCfg.Claves(Seccion); Hashtable hAyuda = new Hashtable(); Hashtable hPrecision = new Hashtable(); Hashtable hValores = new Hashtable(); bool SecAyuda = false; bool SecPrecision = false; float Precision = 0; //ICollection ckeys; //ckeys = h.Keys; dgGramaticas.Rows.Clear(); if (h.Count == 0) { return; } SeccionValores = h["SeccionValores"].ToString(); hValores = mCfg.Claves(SeccionValores); if (h.Contains("SeccionAyuda")) { SecAyuda = true; hAyuda = mCfg.Claves(h["SeccionAyuda"].ToString()); } if (h.Contains("SeccionPrecision")) { SecPrecision = true; hPrecision = mCfg.Claves(h["SeccionPrecision"].ToString()); } if (h.Contains("ValorPrecision")) { Precision = Convert.ToInt16(h["ValorPrecision"].ToString()) / 100; } foreach (DictionaryEntry entry in h) { string sPrecision; string sClave = ""; string sComandoVoz = ""; string sAyuda = ""; string sMacro = ""; string[] row = new string[5]; sPrecision = ""; if ((entry.Key.ToString() != "SeccionValores") && (entry.Key.ToString() != "SeccionAyuda") && (entry.Key.ToString() != "SeccionPrecision")) { sClave = entry.Key.ToString(); sComandoVoz = entry.Value.ToString(); sAyuda = mCfg.RecuperarValorSeccion(hAyuda, sClave, SecAyuda); sPrecision = mCfg.RecuperarValorSeccion(hPrecision, sClave, SecPrecision); if (SeccionValores != "") { sMacro = hValores[entry.Key.ToString()].ToString(); } row[0] = sClave; row[1] = sComandoVoz; row[2] = sPrecision; row[3] = sAyuda; row[4] = sMacro; if (sClave != "") { dgGramaticas.Rows.Add(row); } } } } else { dgGramaticas.Rows.Clear(); } }