Пример #1
0
        void OnUserTyping(object sender, UserTypingEventArgs e)
        {
            var participant = participants.Single(vm => vm.Contact == e.User);

            if (e.Starting)
            {
                typingParticipants.Add(participant);
            }
            else
            {
                typingParticipants.Remove(participant);
            }
        }
Пример #2
0
        private void RainbowInstantMessaging_UserTypingChanged(object sender, UserTypingEventArgs e)
        {
            bool   concernCurrentSelection = false;
            string contactDisplayName      = "";

            // Check if event recevied concern the form selection or not
            if (selectionCorrect)
            {
                Conversation conversation = rainbowConversations.GetConversationByIdFromCache(e.ConversationId);
                if (contactSelected)
                {
                    if (conversation != null)
                    {
                        concernCurrentSelection = ((conversation.Type == Conversation.ConversationType.User) && (idSelected == conversation.PeerId));

                        Contact contact = rainbowContacts.GetContactFromContactId(idSelected);
                        contactDisplayName = GetContactDisplayName(contact);
                    }
                    else
                    {
                        AddStateLine($"ContactSelected - No conversation found");
                        return;
                    }
                }
                else
                {
                    concernCurrentSelection = (idSelected == e.ConversationId);
                    if (conversation != null)
                    {
                        if (conversation.Type == Conversation.ConversationType.User)
                        {
                            Contact contact = rainbowContacts.GetContactFromContactId(conversation.PeerId);
                            contactDisplayName = GetContactDisplayName(contact);
                        }
                        else
                        {
                            contactDisplayName = conversation.Name;
                            if (String.IsNullOrEmpty(contactDisplayName))
                            {
                                contactDisplayName = conversation.Id;
                            }
                        }
                    }
                    else
                    {
                        AddStateLine($"ConversationSelected - No conversation found");
                        return;
                    }
                }

                if (concernCurrentSelection)
                {
                    if (e.IsTyping)
                    {
                        AddStateLine($"[{contactDisplayName}] is typing in the CURRENT SELECTED conversation.");
                    }
                }
                else
                {
                    if (e.IsTyping)
                    {
                        AddStateLine($"[{contactDisplayName}] is typing in ANOTHER conversation.");
                    }
                }
            }
        }
Пример #3
0
 internal void OnUserTypingChanged(object sender, UserTypingEventArgs args)
 {
     UserTypingChanged.Raise(sender, args);
 }