Example #1
0
            internal void ToStringBuilder(StringBuilder buffer)
            {
                if (Severity != null)
                {
                    buffer.Append("[");
                    buffer.Append(Severity.ToString().ToUpper());
                    buffer.Append("] ");
                }

                buffer.Append(Details?.Text ?? "(no details)");

                if (Diagnostics != null)
                {
                    buffer.Append("(further diagnostics: ");
                    buffer.Append(Diagnostics);
                    buffer.Append(")");
                }

                if (Location.Any())
                {
                    buffer.Append(" (at ");
                    buffer.Append(String.Join(" via ", Location));
                    buffer.Append(")");
                }
            }
Example #2
0
            public override string ToString()
            {
                string text = "";

                if (Severity != null)
                {
                    text += "[" + Severity.ToString().ToUpper() + "] ";
                }

                text += Details?.Text ?? "(no details)";

                if (Diagnostics != null)
                {
                    text += $"(further diagnostics: {Diagnostics})";
                }

                if (Location.Any())
                {
                    text += " (at " + String.Join(", ", Location) + ")";
                }

                return(text);
            }