private void User_OnClick(object sender, RoutedEventArgs e) { var s = sender as Button; DisplayInfo.DisplayName = s.Content.ToString(); DisplayInfo.Type = DisplayInfoModel.Types.Unicast; MessageWpfShow?.Invoke(null, null); }
private void Room_OnMouseClick(object sender, MouseButtonEventArgs e) { var s = sender as TreeViewItem; DisplayInfo.DisplayName = s.Header.ToString(); DisplayInfo.Id = new Guid(s.Tag.ToString()); DisplayInfo.Type = DisplayInfoModel.Types.Room; MessageWpfShow?.Invoke(null, null); }
private void _client_RoomMessageReceived(object sender, RoomMessage e) { var message = new MessageViewModel() { Username = e.Username, DateTime = e.DateTime, Message = e.Message, TargetInfo = e.RoomId.ToString() }; _messagesRevieved.Add(message); MessageWpfShow?.Invoke(message, "Recieved"); }
private void _client_BroadcastMessageReceived(object sender, BroadcastMessage e) { //if(Messages.Count > 500) Messages.RemoveAt(0); var message = new MessageViewModel() { Username = e.Username, DateTime = e.DateTime, Message = e.Message, TargetInfo = "Home" }; _messagesRevieved.Add(message); MessageWpfShow?.Invoke(message, "Recieved"); }
private void _client_UnicastMessageReceived(object sender, UnicastMessage e) { var localuser = Settings.Username + Ip; var message = new MessageViewModel() { Username = e.Username, DateTime = e.DateTime, Message = e.Message, TargetInfo = localuser == e.Username ? e.UserReciever : e.Username }; _messagesRevieved.Add(message); MessageWpfShow?.Invoke(message, "Recieved"); }
private void Home_OnClick(object sender, RoutedEventArgs e) { DisplayInfo.DisplayName = "Home"; DisplayInfo.Type = DisplayInfoModel.Types.Broadcast; MessageWpfShow?.Invoke(null, null); }