示例#1
0
 private void ContextMenuAddFriend_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         SausageClient.AddFriend(SausageClient.Vm.SelectedUser.Guid);
     }
     catch (Exception) { }
 }
示例#2
0
        private void Send_message_Button_Click(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrEmpty(User_Message_client_Copy.Text))
            {
                PacketFormat packet = new PacketFormat(PacketOption.ClientMessage)
                {
                    Guid    = SausageClient.ClientInfo.Guid,
                    Content = User_Message_client_Copy.Text
                };
                SausageClient.Send(packet);

                User_Message_client_Copy.Text = string.Empty;
            }
        }
示例#3
0
 private void User_Message_client_Copy_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         // send the message
         PacketFormat packet = new PacketFormat(PacketOption.ClientMessage)
         {
             Guid    = SausageClient.ClientInfo.Guid,
             Content = User_Message_client_Copy.Text
         };
         SausageClient.Send(packet);
         // reset the text box
         User_Message_client_Copy.Text = string.Empty;
     }
 }
示例#4
0
        private void Button_Click_change_name(object sender, RoutedEventArgs e)
        {
            try
            {
                if (!SausageClient.Socket.Connected)
                {
                    return;
                }
            }
            catch (NullReferenceException)
            {
                return;
            }
            Window1 win2 = new Window1();

            win2.ShowDialog();

            if (Window1.UserInput != SausageClient.ClientInfo.Name)
            {
                SausageClient.Rename(Window1.UserInput);
            }
        }
示例#5
0
 private void Disconnect_Button_Client_Click(object sender, RoutedEventArgs e) => SausageClient.Disconnect();
示例#6
0
 private void Connect_Button_Client_Click(object sender, RoutedEventArgs e)
 {
     SausageClient.Start(Which_IP_is_selected());
 }