private void ContextMenuAddFriend_Click(object sender, RoutedEventArgs e) { try { SausageClient.AddFriend(SausageClient.Vm.SelectedUser.Guid); } catch (Exception) { } }
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; } }
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; } }
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); } }
private void Disconnect_Button_Client_Click(object sender, RoutedEventArgs e) => SausageClient.Disconnect();
private void Connect_Button_Client_Click(object sender, RoutedEventArgs e) { SausageClient.Start(Which_IP_is_selected()); }