Пример #1
0
        public void ClearLog()
        {
            LastLogMessage = null;

            while (ConsoleLog.ChildNodes.Length > 0)
            {
                ConsoleLog.RemoveChild(ConsoleLog.LastChild);
            }
        }
Пример #2
0
        public void LogMessage(string message, bool newLine = true)
        {
            if (message == null)
            {
                message = "";
            }

            message = GetSecureTag() + message;

            var createdNew = false;
            if (LastLogMessage == null || newLine)
            {
                LastLogMessage = Document.CreateElement<PreElement>("p");
                LastLogMessage.Style.WordWrap = WordWrap.Normal;
                LastLogMessage.Style.Margin = "5px";
                createdNew = true;
            }

            if (createdNew)
            {
                LastLogMessage.InnerHTML = message;
                ConsoleLog.AppendChild(LastLogMessage);
            }
            else
            {
                LastLogMessage.InnerHTML += message;
            }

            ConsoleLog.ScrollTop = ConsoleLog.ScrollHeight;
        }