Exemplo n.º 1
0
        public void RemoveOldCenterSectionsFromThread()
        {
            var sectionsToRemove = ChatThread.Where(x => x.Direction == MessageDirection.AwkwardCenter && ChatThread.LastOrDefault() != x).ToList();

            foreach (var section in sectionsToRemove)
            {
                ChatThread.Remove(section);
            }
        }
Exemplo n.º 2
0
        public void ToggleTyping(bool show)
        {
            var incommingChat  = ChatThread.Where(x => x.Direction == MessageDirection.In);
            var alreadyVisible = incommingChat.Count() > 0 && incommingChat.Last().SectionType == SectionTypeEnum.Typing;

            if (!alreadyVisible && show)
            {
                ChatThread.Add(new Section()
                {
                    SectionType = SectionTypeEnum.Typing, _id = Guid.NewGuid().ToString()
                });
            }
            if (alreadyVisible && !show)
            {
                ChatThread.Remove(incommingChat.Last());
            }
        }