public void Add(string text, FontAndColorSetting format)
            {
                SimpleTextRunProperties props;

                if (!propMap.TryGetValue(format.GetHashCode(), out props))
                {
                    props = new SimpleTextRunProperties(format);
                    propMap.Add(format.GetHashCode(), props);
                }

                var span = new FormattedSpan(textBuilder.Length, text.Length, props);

                textBuilder.Append(text);
                spans.Add(span);

                cache.Change(span.Start, span.Length, 0);
            }
 public FormattedSpan(int start, int length, SimpleTextRunProperties format)
 {
     this.Start  = start;
     this.Length = length;
     this.Format = format;
 }