private void ClickGoBackToMenu(object sender, EventArgs e) { MenuWindow menuWindow = new MenuWindow(username); menuWindow.Show(); this.Close(); }
/// <summary> /// The class constructor that is invoked to replace the contents of the window. /// </summary> /// <param name="menuWindow"> The window that is showing this page. </param> public VerMarcadoresWindow(MenuWindow menuWindow) { InitializeComponent(); this.menuWindow = menuWindow; Proxy.MenuServiceClient server = new Proxy.MenuServiceClient(); var playersList = server.GetScores(); server.Close(); DataContext = playersList; }
private void ClickLogIn(object sender, RoutedEventArgs e) { string email = TextBoxEmail.Text; string password = TextBoxPassword.Password; if (!string.IsNullOrEmpty(email) && !string.IsNullOrEmpty(password)) { String emailFormat = "\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"; if (Regex.IsMatch(email, emailFormat)) { try { Proxy.LoginServiceClient server = new Proxy.LoginServiceClient(); string isValid = server.LogIn(email, password); server.Close(); if (!string.IsNullOrEmpty(isValid)) { MenuWindow sesion = new MenuWindow(isValid); sesion.Show(); this.Close(); } else { LabelAlert.Content = Properties.Resources.NoMatch; } } catch (System.ServiceModel.EndpointNotFoundException ex) { Console.WriteLine(ex.ToString()); LabelAlert.Content = Properties.Resources.ServerIsOff; } } else { LabelAlert.Content = Properties.Resources.InvalidEmail; } } else { LabelAlert.Content = Properties.Resources.EmptyFields; } }
/// <summary> /// The class constructor that is invoked to replace the contents of the window. /// </summary> /// <param name="menuWindow"> The window that is showing this page. </param> /// <param name="username"> The user in logged in session. </param> public JugarMultijugadorWindow(MenuWindow menuWindow, string username) { InitializeComponent(); this.menuWindow = menuWindow; this.username = username; Games = new ObservableCollection <string>(); Players = new ObservableCollection <string>(); Players.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(LoadingRow); DataContext = this; PlayersGrid.Visibility = Visibility.Hidden; context = new InstanceContext(this); server = new Proxy.LobbyServiceClient(context); NumPlayers = new ObservableCollection <int> { 2, 3, 4 }; server.JoinLobby(username); server.GetGames(); }
/// <summary> /// The class constructor that is invoked to replace the contents of the window. /// </summary> /// <param name="menuWindow"> The window that is showing this page. </param> /// <param name="username"> The user in logged in session. </param> public CambiarContraseñaWindow(MenuWindow menuWindow, string username) { InitializeComponent(); this.menuWindow = menuWindow; this.username = username; }