Пример #1
0
 void ConnectUser()
 {
     if (!isConnected)
     {
         client = new ServiceChatClient(new InstanceContext(this));
         ID     = client.Connect(Login, Password);
         client.UpdateUsersList();
         client.RoomListRequest(ID);
         tbUserName.IsEnabled = false;
         btnConnect.Content   = "Disconnect";
         isConnected          = true;
     }
 }
Пример #2
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         client.UpdateUsersList();
         //TODO: НИФИГА не работает выбор первого элемента. Исправить!
         lbRooms.SelectedIndex = 0;
         tbUserName.IsEnabled  = true;
         btnConnect.Content    = "Connect";
         client      = null;
         isConnected = false;
     }
 }