public MenuWindow(int usuarioID) { InitializeComponent(); content = Content; usuario = usuarioID; InstanceContext context = new InstanceContext(new MyCallback()); Proxy.ChatServiceClient server = new Proxy.ChatServiceClient(context); server.Join(usuario); }
private void buttonTest_Click(object sender, EventArgs e) { InstanceContext context = new InstanceContext(new MyCallback()); Proxy.ChatServiceClient server = new Proxy.ChatServiceClient(context); var message = TextBoxChat.Text; if (!string.IsNullOrEmpty(message)) { server.SendMessage(message); } LabelTextChat.Content += "\n " + "Tu : " + message; TextBoxChat.Clear(); }
/// <summary> /// The class constructor that initialize the game values. /// </summary> /// <param name="idGame"> Game identifier to which the user is in. </param> /// <param name="username"> The username of the user logged in sesion. </param> /// <param name="isHost"> A Boolean value that determines if the user is the owner of the game. </param> public GameWindow(int idGame, string username, bool isHost) { InitializeComponent(); this.GameId = idGame; this.username = username; this.isHost = isHost; context = new InstanceContext(this); serverChat = new Proxy.ChatServiceClient(context); serverChat.JoinChat(idGame, this.username); serverGame = new Proxy.GameServiceClient(context); serverGame.JoinCurrentGame(idGame, this.username); serverGame.GetPlayersName(GameId); serverGame.GetFirstSevenTiles(idGame); }
/// <summary> /// The class constructor initializes the menu and verifies that the user is registered. /// </summary> /// <param name="username"> The user in logged in session. </param> public MenuWindow(string username) { InitializeComponent(); content = Content; this.username = username; context = new InstanceContext(this); server = new Proxy.ChatServiceClient(context); Proxy.LoginServiceClient verificator = new Proxy.LoginServiceClient(); if (verificator.IsVerified(username)) { server.JoinChat(0, username); } else { UserNotVerified(); } verificator.Close(); }