private void TraducirMenu(IdiomaSubject idioma) { foreach (TreeViewItem item in treeViewMenu.Items) { if (item.Tag != null) { Leyenda leyenda = idioma.Idioma.Leyendas.Find( delegate(Leyenda leye) { return(leye.Etiqueta.Equals(((string)item.Tag).Split('|').GetValue(1))); } ); if (leyenda != null) { item.Header = leyenda.Traduccion.TextoTraducido; } } TraducirNodos(item, idioma); } foreach (TreeViewItem item in treeViewIdioma.Items) { if (item.Tag != null) { Leyenda leyenda = idioma.Idioma.Leyendas.Find( delegate(Leyenda leye) { return(leye.Etiqueta.Equals(((string)item.Tag).Split('|').GetValue(1))); } ); if (leyenda != null) { item.Header = leyenda.Traduccion.TextoTraducido; } } } }
public void Update(IdiomaSubject idioma) { if (idioma.Idioma != null) { TraducirMenu(idioma); foreach (TextBlock textBlock in SingletonIdioma.FindWindowChildren <TextBlock>(this)) { if (textBlock.Tag != null) { Leyenda leyenda = idioma.Idioma.Leyendas.Find( delegate(Leyenda leye) { return(leye.Etiqueta.Equals((string)textBlock.Tag)); } ); if (leyenda != null) { textBlock.Text = leyenda.Traduccion.TextoTraducido; } } } foreach (ComboBox comboBox in SingletonIdioma.FindWindowChildren <ComboBox>(this)) { if (comboBox.Tag != null) { Leyenda leyenda = idioma.Idioma.Leyendas.Find( delegate(Leyenda leye) { return(leye.Etiqueta.Equals((string)comboBox.Tag)); } ); if (leyenda != null) { HintAssist.SetHint(comboBox, leyenda.Traduccion.TextoTraducido); } } } Leyenda leyendaCombo = idioma.Idioma.Leyendas.Find(delegate(Leyenda leye) { return(leye.Etiqueta.Equals((string)cmbIdioma.Tag)); } ); if (leyendaCombo != null) { HintAssist.SetHint(cmbIdioma, leyendaCombo.Traduccion.TextoTraducido); } } }