Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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");
        }
Esempio n. 4
0
        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");
        }
Esempio n. 5
0
        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");
        }
Esempio n. 6
0
 private void Home_OnClick(object sender, RoutedEventArgs e)
 {
     DisplayInfo.DisplayName = "Home";
     DisplayInfo.Type        = DisplayInfoModel.Types.Broadcast;
     MessageWpfShow?.Invoke(null, null);
 }