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); }
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()); } }
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(); }
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(); }