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)
            {
                foreach (TextBox txtBox in SingletonIdioma.FindWindowChildren <TextBox>(this))
                {
                    if (txtBox.Tag != null)
                    {
                        Leyenda leyenda = idioma.Idioma.Leyendas.Find(delegate(Leyenda leye) { return(leye.Etiqueta.Equals((string)txtBox.Tag)); });

                        if (leyenda != null)
                        {
                            MaterialDesignThemes.Wpf.HintAssist.SetHint(txtBox, leyenda.Traduccion.TextoTraducido);
                        }
                        //txtBox.Text = leyenda.Traduccion.TextoTraducido;
                    }
                }

                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 (Button button in SingletonIdioma.FindWindowChildren <Button>(this))
                {
                    if (button.Tag != null)
                    {
                        Leyenda leyenda = idioma.Idioma.Leyendas.Find(
                            delegate(Leyenda leye) { return(leye.Etiqueta.Equals((string)button.Tag)); }
                            );

                        if (leyenda != null)
                        {
                            button.Content = 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);
                }
            }
        }
 /// <summary>
 /// Prevents a default instance of the <see cref="ManejadorSesion" /> class from being created.
 /// </summary>
 private SingletonIdioma()
 {
     IdiomaSubject = new IdiomaSubject();
 }
Exemple #5
0
 public void Update(IdiomaSubject idioma)
 {
 }
Exemple #6
0
        public void Update(IdiomaSubject idioma)
        {
            if (idioma.Idioma != null)
            {
                foreach (TextBox txtBox in SingletonIdioma.FindWindowChildren <TextBox>(this))
                {
                    if (txtBox.Tag != null)
                    {
                        Leyenda leyenda = idioma.Idioma.Leyendas.Find(
                            delegate(Leyenda leye) { return(leye.Etiqueta.Equals((string)txtBox.Tag)); }
                            );

                        if (leyenda != null)
                        {
                            HintAssist.SetHint(txtBox, leyenda.Traduccion.TextoTraducido);
                        }
                        txtBox.Text = txtBox.Text;
                    }
                }

                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);
                        }
                    }
                }

                foreach (PasswordBox passwordBox in SingletonIdioma.FindWindowChildren <PasswordBox>(this))
                {
                    if (passwordBox.Tag != null)
                    {
                        Leyenda leyenda = idioma.Idioma.Leyendas.Find(
                            delegate(Leyenda leye) { return(leye.Etiqueta.Equals((string)passwordBox.Tag)); }
                            );

                        if (leyenda != null)
                        {
                            HintAssist.SetHint(passwordBox, leyenda.Traduccion.TextoTraducido);
                        }
                    }
                }

                foreach (Button button in SingletonIdioma.FindWindowChildren <Button>(this))
                {
                    if (button.Tag != null)
                    {
                        Leyenda leyenda = idioma.Idioma.Leyendas.Find(
                            delegate(Leyenda leye) { return(leye.Etiqueta.Equals((string)button.Tag)); }
                            );

                        if (leyenda != null)
                        {
                            button.Content = leyenda.Traduccion.TextoTraducido;
                        }
                    }
                }
            }
        }
 public Idioma()
 {
     IdiomaSubject = new IdiomaSubject();
 }