Beispiel #1
0
 internal bool MessageBelongsToMe(Core.Messages.FSD.ATextMessage textMessage, string pilotCallsign)
 {
     return(IsAllTab ||
            (!IsPrivateChat && textMessage.Receiver == ChannelFreq) ||                           // Not a private chat, freq. matches
            IsPrivateChat &&                                                                     // Is a private chat, and...
            ((textMessage.Sender != pilotCallsign && textMessage.Sender == ChannelFreq) ||       // either the sender is NOT me and the sender matches the freq
             (textMessage.Sender == pilotCallsign && textMessage.Receiver == ChannelFreq))       // or the sender IS me, and the receiver matches the freq
            );
 }
Beispiel #2
0
        internal void ShowMessage(Core.Messages.FSD.ATextMessage textMessage)
        {
            Action action = () => ListBox.Items.Add(new ListBoxItem()
            {
                Content = string.Format("{0}> {1}", textMessage.Sender, textMessage.Text)
            });

            if (ListBox.Dispatcher.CheckAccess())
            {
                action();
            }
            else
            {
                ListBox.Dispatcher.BeginInvoke(action);
            }
        }