Beispiel #1
0
        public void AddIncommingSection(Section sec)
        {
            if (sec == null)
            {
                return;
            }

            sec.Direction = MessageDirection.In;
            if (sec is TextSection textSec)
            {
                textSec.Text = VerbProcessor.Process(textSec.Text);
            }

            ChatThread.Add(sec);
        }
Beispiel #2
0
 public void AddOutgoingSection(Section sec)
 {
     if (sec == null)
     {
         return;
     }
     sec.Direction = MessageDirection.Out;
     sec.DelayInMs = 0;
     sec.Hidden    = false;
     if (sec is TextSection textSec)
     {
         textSec.Text = VerbProcessor.Process(textSec.Text);
     }
     ChatThread.Add(sec);
 }
        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());
            }
        }
Beispiel #4
0
        public void AddCenterSection(Section sec)
        {
            if (sec == null)
            {
                return;
            }

            sec.Direction = MessageDirection.AwkwardCenter;
            if (sec is TextSection textSec)
            {
                textSec.Text = VerbProcessor.Process(textSec.Text);
            }

            sec.Sno = (ChatThread.Count + 1);
            ChatThread.Add(sec);

            RemoveOldCenterSectionsFromThread();
        }
Beispiel #5
0
        public void AddOutgoingSection(Section sec)
        {
            if (sec == null)
            {
                return;
            }
            sec.Direction = MessageDirection.Out;
            sec.DelayInMs = 0;
            sec.Hidden    = false;
            if (sec is TextSection textSec)
            {
                textSec.Text = VerbProcessor.Process(textSec.Text);
            }
            sec.Sno = (ChatThread.Count + 1);
            ChatThread.Add(sec);

            RemoveOldCenterSectionsFromThread();
        }