コード例 #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);
        }
コード例 #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);
 }
コード例 #3
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());
            }
        }
コード例 #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();
        }
コード例 #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();
        }