public void Disconect()
 {
     if (chatUser.UserID != "" && chatUser.UserID != null)
     {
         client.Disconnect(chatUser.UserID);
     }
 }
Beispiel #2
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         client      = null;
         isConnected = false;
     }
 }
Beispiel #3
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         bConDiscon.Content   = "Подключиться";
         isConnected          = false;
         tbUserName.IsEnabled = true;
     }
 }
Beispiel #4
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         client = null;
         texBoxUserName.IsEnabled = true;
         buttonConnect.Content    = "Connect";
         isConnected = false;
     }
 }
Beispiel #5
0
 void DisconnectUser()   // Отключение от сервиса
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         client = null;
         tbUserName.IsEnabled = true;
         bConnDicon.Content   = "Connect";
         isConnected          = false;
     }
 }
Beispiel #6
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         client             = null;
         tbUserName.Enabled = true;
         bConnDicon.Text    = "Connect";
         isConnected        = false;
     }
 }
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         client = null;
         tbUserName.IsEnabled = true; //коли відключені то можем поміняти імя
         bConnDicon.Content   = "Connect";
         isConnected          = false;
     }
 }
Beispiel #8
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(id);
         client = null;
         tbUserName.IsEnabled = true;
         btConnect.Content    = "Присоедениться";
         isConnected          = false;
     }
 }
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         client = null;
         tbUserMame.IsEnabled = true;
         bConnDisconn.Content = "Connect";
         isConnected          = false;
     }
 }
Beispiel #10
0
 private void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(id);
         client = null;
         tbUserName.IsEnabled = true;
         bConnDisconn.Content = "Connected";
         isConnected          = false;
     }
 }
Beispiel #11
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(clientId);
         client               = null;
         isConnected          = false;
         tbUserName.IsEnabled = true;
         bCD.Content          = "Connect";
     }
 }
Beispiel #12
0
 void Disconnect()
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         client        = null;
         TB.IsEnabled  = true;
         TextBloc.Text = "Вхід";
         isConnected   = false;
     }
 }
 // Метод отключения
 public void Disconnect()
 {
     // Если подлючены, отправляем сервису свой ид в методе отключения
     if (IsConnected)
     {
         client.Disconnect(id);
         tbUserName.IsEnabled = true;
         btnConnect.Content   = "Подключиться";
         IsConnected          = false;
     }
 }
Beispiel #14
0
 //отключение от сервера
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(Id);
         client = null;
         tblockUserName.IsEnabled = true;
         lbUsersList.Items.Clear();
         tblockUserName.Foreground = Brushes.Red;
         isConnected = false;
     }
 }
Beispiel #15
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         client           = null;
         textBox2.Enabled = true;
         button1.Text     = "Присоединиться";
         listBox1.Items.Clear();
         isConnected = false;
     }
 }
Beispiel #16
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         client = null;
         tbUserName.IsEnabled = true;
         bConDis.Content      = "Connect";
         bConDis.Background   = Brushes.Green;
         isConnected          = false;
     }
 }
Beispiel #17
0
        //--------------------------------------------------------------------------------------------------------------------------

        /// <summary>
        /// отключение пользователя от сервиса
        /// </summary>
        void DisconnectUser()
        {
            if (isConnected)
            {
                client.Disconnect(id);
                client = null;
                tbUserName.IsEnabled = true;
                bConnDiscon.Content  = "Connect";
                isConnected          = false;
                ShowListUsers(listUser);
            }
        }
Beispiel #18
0
        void DisconnectUser()
        {
            if (isConnected)
            {
                client.Disconnect(ID);
                client           = null;
                isConnected      = false;
                button1.Text     = "Подключиться";
                textBox1.Enabled = true;

                listBox1.Items.Clear();
            }
        }
Beispiel #19
0
 void Disconnect()
 {
     if (isConnected)
     {
         client.Disconnect(id);
         client = null;
         tbUserName.IsEnabled   = true;
         bConnDiscon.Content    = "Connect";
         tbStatusBar.Text       = "offline";
         tbStatusBar.Foreground = (Brush)System.ComponentModel.TypeDescriptor.GetConverter(typeof(Brush)).ConvertFromInvariantString("Red");
         isConnected            = false;
     }
 }
Beispiel #20
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         if (client != null)
         {
             client.Disconnect(userID);
             client = null;
         }
         tbUserName.IsEnabled       = true;
         bConnectDisconnect.Content = "Connect";
         isConnected = false;
     }
 }
Beispiel #21
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         client.Disconnect(ID);
         client.UpdateUsersList();
         //TODO: НИФИГА не работает выбор первого элемента. Исправить!
         lbRooms.SelectedIndex = 0;
         tbUserName.IsEnabled  = true;
         btnConnect.Content    = "Connect";
         client      = null;
         isConnected = false;
     }
 }
 private void DisconnectUser()
 {
     if (_isConnected)
     {
         _chatClient.Disconnect(_userId);
         _chatClient  = null;
         _isConnected = false;
         UserNameTextBox.IsEnabled         = true;
         UserNameTextBox.Text              = "";
         MessageTextBox.IsEnabled          = false;
         MessageTextBox.Text               = "";
         ConnectOrDisconnectButton.Content = "Присоединиться к чату";
     }
 }
Beispiel #23
0
 void DisconnectUser()
 {
     client.Disconnect(Id);
     client = null;
     tbUserName.IsEnabled = true;
     bConnDiscon.Content  = "Connect";
     isConnected          = false;
     if (client == null)
     {
         LState.Content = "Error";
     }
     else
     {
         LState.Content = client.State;
     }
 }
Beispiel #24
0
 void DisconnectUser()
 {
     if (isConnected)
     {
         try
         {
             client.Disconnect(ID);
             client = null;
             tbUserName.IsEnabled = true;
             bConnDicon.Content   = "Connect";
             isConnected          = false;
         }catch (Exception ex)
         {
             tbMessage.Text = ex.ToString();
         }
     }
 }
Beispiel #25
0
 void  disconnect()
 {
     try
     {
         if (isConnect)
         {
             client.Disconnect(UserInLog.id);
             client           = null;
             tbName.IsEnabled = true;
             btnCon.Content   = "Connect";
             isConnect        = false;
             chat.Items.Clear();
             //Список онлайн юзерів
             listUsers.ItemsSource = null;
             listUsers.Items.Refresh();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #26
0
 private void disconnect()
 {
     client.Disconnect(userId);
 }
Beispiel #27
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                return;
            }
            client = new ServiceChatClient(new System.ServiceModel.InstanceContext(new Program()));
            id     = client.Connect(args[0]);



            while (true)
            {
                PrintMenu();
                Console.WriteLine("Input option");
                char key = Console.ReadKey().KeyChar;
                Console.WriteLine();
                switch (key)
                {
                case 'w':
                {
                    int    receiverId;
                    string mes;
                    lock (locker)
                    {
                        Console.WriteLine("Write receiver Id");
                        if (!Int32.TryParse(Console.ReadLine(), out receiverId))
                        {
                            Console.WriteLine("Wrong input!");
                            continue;
                        }
                        Console.WriteLine("Write message");
                        mes = Console.ReadLine();
                    }
                    client.SendMsg(mes, receiverId, id);
                }; break;

                case 'u':
                {
                    Console.WriteLine("Users ID: ");
                    var usersId = client.GetServerUsers();
                    for (int i = 0; i < usersId.Length; i++)
                    {
                        Console.Write(usersId[i] + " ");
                    }
                    Console.WriteLine();
                }; break;

                case 'i':
                {
                    Console.WriteLine("Your data:\n" +
                                      $"\tID - {id}\n" +
                                      $"\tNickName - {args[0]}"
                                      );
                }; break;

                case 'e':
                {
                    client.Disconnect(id);
                    Console.WriteLine("Disconnect...");
                    return;
                }

                default:
                {
                    Console.WriteLine("Wrong command!");
                    continue;
                }
                }
            }
        }
Beispiel #28
0
 private void Wind_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     client.Disconnect(_user.IdLogin);
 }