示例#1
0
        internal void Layout(ICTextMeasure measure, float contentWidth, float maxWidth)
        {
            if (this.IsPlain)
            {
                if (this.level == CLogLevel.Exception)
                {
                    CStackTraceLine[] stackLines = this.data as CStackTraceLine[];
                    if (stackLines == null && this.stackTrace != null)
                    {
                        stackLines = CEditorStackTrace.ParseStackTrace(this.stackTrace);
                        this.data  = stackLines;
                    }

                    LayoutException(measure, stackLines, maxWidth);
                }
                else
                {
                    LayoutPlain(measure, maxWidth);
                }
            }
            else if (this.IsTable)
            {
                string[] table = this.Table;
                CAssert.IsNotNull(table);

                LayoutTable(measure, table, contentWidth, maxWidth);
            }
            else
            {
                throw new NotImplementedException("Unexpected entry type");
            }
        }
示例#2
0
        private string FormatLine(string line, CLogLevel level, CTag tag, string stackTrace)
        {
            StringBuilder lineBuffer = new StringBuilder();

            string coloredLine = CEditorSkin.SetColors(line);

            string filename = CEditorStackTrace.ExtractFileName(stackTrace);

            if (level != null)
            {
                lineBuffer.Append("[");
                lineBuffer.Append(level.ShortName);
                lineBuffer.Append("]: ");
            }

            if (filename != null)
            {
                lineBuffer.Append(CStringUtils.C("[" + filename + "]: ", CEditorSkin.GetColor(CColorCode.Plain)));
            }

            if (tag != null)
            {
                lineBuffer.Append("[");
                lineBuffer.Append(tag.Name);
                lineBuffer.Append("]: ");
            }

            lineBuffer.Append(coloredLine);

            return(lineBuffer.ToString());
        }
示例#3
0
        //////////////////////////////////////////////////////////////////////////////

        public override bool OnMouseDoubleClick(CEvent evt)
        {
            if (!string.IsNullOrEmpty(StackTrace))
            {
                if (CEditor.OpenFileExternal(StackTrace))
                {
                    return(true);
                }
            }
            else if (this.LogLevel == CLogLevel.Error || this.LogLevel == CLogLevel.Warn)
            {
                CSourcePathEntry element;
                if (CEditorStackTrace.TryParseCompilerMessage(m_value, out element))
                {
                    if (CEditor.OpenFileAtLineExternal(element.sourcePath, element.lineNumber))
                    {
                        return(true);
                    }
                }
            }

            return(base.OnMouseDoubleClick(evt));
        }