void ConnectUser() { if (!IsConnected) { ID = client.Connect(tbUserName.Text); IsConnected = true; CB.Content = "Disconnect"; tbUserName.IsEnabled = false; } }
void ConnectUser() { if (!isConnected) { client = new ServiceChat.ServiceChatClient(new System.ServiceModel.InstanceContext(this)); ID = client.Connect(nicknameTextBox.Text); nicknameTextBox.IsEnabled = false; connectButton.Content = "Disconnect"; isConnected = true; } }
void ConnectUser() { if (!IsConnected) { client = new ServiceChat.ServiceChatClient(new System.ServiceModel.InstanceContext(this)); ID = client.Connect(tbUserName.Text); tbUserName.IsEnabled = false; bConnDisconn.Content = "Disconnect"; IsConnected = true; } }
void ConnectUser() { if (!isConnected) { client = new ServiceChatClient(new System.ServiceModel.InstanceContext(this)); ID = client.Connect(textBoxUsername.Text); textBoxUsername.IsEnabled = false; bConnectDisconnect.Content = "Disconnect"; isConnected = true; } }
void ConnectUser() { if (!isConnected) { client = new ServiceChat.ServiceChatClient(new System.ServiceModel.InstanceContext(this)); ID = client.Connect(tbUserName.Text); //подключение юзера с указанным ID tbUserName.IsEnabled = false; //блокировка возможности изменить имя юзера Button_Connect_Disconnect.Content = "Disconnect"; //что будет написано на кнопке, когда пользователь подключился //при нажатии на эту кнопку юзер будет отключен isConnected = true; } }