예제 #1
0
        private void AbrirLogin()
        {
            string nickname = (DataContext as Jugador).Nickname;

            try
            {
                LoginAdmin.CerrarSesion(nickname);
            }
            catch (EndpointNotFoundException)
            {
                new Mensaje
                {
                    TituloMensaje = Properties.Resources.ErrorServidor_TituloContenido,
                    Contenido     = Properties.Resources.ErrorServidor_MensajeContenido
                }.ShowDialog();
            }
            catch (CommunicationObjectFaultedException)
            {
                new Mensaje
                {
                    TituloMensaje = Properties.Resources.ErrorServidor_TituloContenido,
                    Contenido     = Properties.Resources.ErrorServidor_MensajeContenido
                }.ShowDialog();
            }

            MenuPrincipal ventanaPrincipal = Application.Current.Windows.OfType <MenuPrincipal>().SingleOrDefault();
            Principal     ventanaLogin     = new Principal();

            ventanaLogin.Show();
            ventanaPrincipal.Close();
        }
예제 #2
0
        private void CerrarSesion(object sender, RoutedEventArgs e)
        {
            string nickname = (DataContext as Jugador).Nickname;

            try
            {
                LoginAdmin.CerrarSesion(nickname);
            }
            catch (EndpointNotFoundException)
            {
                new Mensaje
                {
                    TituloMensaje = Properties.Resources.ErrorServidor_TituloContenido,
                    Contenido     = Properties.Resources.ErrorServidor_MensajeContenido
                }.ShowDialog();
            }
            catch (CommunicationObjectFaultedException)
            {
                new Mensaje
                {
                    TituloMensaje = Properties.Resources.ErrorServidor_TituloContenido,
                    Contenido     = Properties.Resources.ErrorServidor_MensajeContenido
                }.ShowDialog();
            }

            Principal ventanaLogin = new Principal();

            ventanaLogin.Show();
            this.Close();
        }