public void Write(string text, object reference, DecompilerReferenceFlags flags, object color)
 {
     if (addIndent)
     {
         AddIndent();
     }
     Debug.Assert(reference != null);
     Debug.Assert(!(reference?.GetType().FullName ?? string.Empty).Contains("ICSharpCode"), "Internal decompiler data shouldn't be passed to Write()-ref");
     referenceBuilder.Add(new Span(stringBuilder.Length, text.Length), new ReferenceInfo(reference, flags));
     AddText(text, color);
 }
 public void Write(string text, int index, int length, object reference, DecompilerReferenceFlags flags, object color)
 {
     VerifyState(State.GeneratingContent);
     if (addIndent)
     {
         AddIndent();
     }
     if (reference == null)
     {
         AddText(text, index, length, color);
         return;
     }
     Debug.Assert(!(reference.GetType().FullName ?? string.Empty).Contains("ICSharpCode"), "Internal decompiler data shouldn't be passed to Write()-ref");
     referenceBuilder.Add(new Span(stringBuilder.Length, length), new ReferenceInfo(reference, flags));
     AddText(text, index, length, color);
 }