Example #1
0
        private void OnFriendChatNotice(FriendChatNotice msg)
        {
            try
            {
                if (msg == null)
                {
                    return;
                }

                if (String.IsNullOrEmpty(msg.FromUserID) || String.IsNullOrEmpty(msg.ToUserID) ||
                    msg.Content == null || msg.Content.Length <= 0)
                {
                    return;
                }

                foreach (ChatListSubItem item in chatListBox1.Items[0].SubItems)
                {
                    if (item.Tag != null && item.Tag.ToString() == msg.FromUserID)
                    {
                        item.IsTwinkle = true;
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Example #2
0
        private void OnFriendChatNotice(FriendChatNotice msg)
        {
            try
            {
                if (msg == null)
                {
                    return;
                }

                if (String.IsNullOrEmpty(msg.FromUserID) || String.IsNullOrEmpty(msg.ToUserID) ||
                    msg.ToUserID != _ToUserID || msg.Content == null || msg.Content.Length <= 0)
                {
                    return;
                }
                String context = msg.Content.ToStringUtf8();
                txtHistory.SelectionStart = txtHistory.Rtf.Length;
                txtHistory.SelectedRtf   += context;
                txtHistory.ScrollToCaret();
            }
            catch (Exception ex)
            {
            }
        }