RequiresSpace() public static method

public static RequiresSpace ( Inline lastInline, Inline nextInline ) : bool
lastInline System.Windows.Documents.Inline
nextInline System.Windows.Documents.Inline
return bool
Exemplo n.º 1
0
 private void AddingChild(Span element, Inline child)
 {
     if (FormattingCalculator.RequiresSpace(element.Inlines.LastInline, child))
     {
         element.Inlines.Add(new Run(" "));
     }
 }
Exemplo n.º 2
0
        private void AddingChild(StringBuilder stringBuilder, XInline child)
        {
            var lastCharacter = stringBuilder.Length > 0 ? stringBuilder[stringBuilder.Length - 1] : '\0';

            if (child is XLineBreak)
            {
                return;
            }

            if (FormattingCalculator.RequiresSpace(lastCharacter, (child.Text ?? string.Empty).FirstOrDefault()))
            {
                stringBuilder.Append(" ");
            }
        }