Beispiel #1
0
        public FormattedTextLinePart AppendText(string Text, TextFormat Format)
        {
            int SpanStart = _Parts.Any() ? _Parts.Last().LineSpan.End : 0;
            int SpanEnd   = SpanStart + Text.Length;

            var LineSpan = TextSpan.FromBounds(SpanStart, SpanEnd);
            var LinePart = new FormattedTextLinePart(Text, LineSpan, Format);

            AddPart(LinePart);
            return(LinePart);
        }
Beispiel #2
0
        public FormattedTextLinePart AppendText(string Text, TextFormat Format)
        {
            var lastPart         = Parts.LastOrDefault();
            var lastPartLineSpan = lastPart?.LineSpan;
            int SpanStart        = _Parts.Any() ? ((TextSpan)lastPartLineSpan).End : 0;
            int SpanEnd          = SpanStart + Text.Length;

            var LineSpan = TextSpan.FromBounds(SpanStart, SpanEnd);
            var LinePart = new FormattedTextLinePart(Text, LineSpan, Format);

            AddPart(LinePart);
            return(LinePart);
        }
Beispiel #3
0
 public void AddPart(FormattedTextLinePart Part)
 {
     Part.Line = this;
     _Parts.Add(Part);
 }