示例#1
0
        internal void RemoveEmptyParagraphs()
        {
            var startParagraph = StartText.GetParent <Paragraph>();

            if (startParagraph?.Parent != null &&
                !startParagraph.HasText() &&
                CanDeleteParagraph(startParagraph))
            {
                startParagraph.Remove();
            }

            var endParagraph = EndText.GetParent <Paragraph>();

            if (endParagraph?.Parent != null &&
                !endParagraph.HasText() &&
                CanDeleteParagraph(endParagraph))
            {
                endParagraph.Remove();
            }

            var tb = this as TextBlock;

            if (tb?.FirstInsertionPointParagraph.Parent != null)
            {
                tb.FirstInsertionPointParagraph.Remove();
            }
        }
示例#2
0
        internal void RemoveEmptyParagraphs()
        {
            var startParagraph = StartText.GetParent <Paragraph>();

            if (startParagraph?.Parent != null &&
                !startParagraph.HasText() &&
                CanDeleteParagraph(startParagraph))
            {
                startParagraph.Remove();
            }

            var endParagraph = EndText.GetParent <Paragraph>();

            if (endParagraph?.Parent != null &&
                !endParagraph.HasText() &&
                CanDeleteParagraph(endParagraph))
            {
                endParagraph.Remove();
            }
        }