public void RenderEvents()
{
StringBuilder txt = new StringBuilder();
bool first = true;
foreach (var evt in History)
{
if (!first) txt.Append("\r\n");
first = false;
txt.Append(RenderEvent(evt));
}
bool scroll = ChatHistoryText.VerticalScrollMax == ChatHistoryText.VerticalScrollPosition;
ChatHistoryText.CurrentText = txt.ToString();
ChatHistoryText.ComputeDrawingCommands();
if (scroll)
{
ChatHistoryText.VerticalScrollPosition = ChatHistoryText.VerticalScrollMax;
}
else
{
ChatHistoryText.VerticalScrollPosition = ChatHistoryText.VerticalScrollPosition;
}
}