Пример #1
0
        // Token: 0x06006514 RID: 25876 RVA: 0x001C5FAC File Offset: 0x001C41AC
        private static void DumpTextParagraphResult(XmlTextWriter writer, TextParagraphResult paragraph, Visual visualParent)
        {
            writer.WriteStartElement("TextParagraph");
            writer.WriteStartElement("Element");
            writer.WriteAttributeString("Type", paragraph.Element.GetType().FullName);
            writer.WriteEndElement();
            LayoutDump.DumpRect(writer, "LayoutBox", paragraph.LayoutBox);
            Visual visualParent2 = LayoutDump.DumpParagraphOffset(writer, paragraph, visualParent);

            LayoutDump.DumpTextRange(writer, paragraph.StartPosition, paragraph.EndPosition);
            LayoutDump.DumpLineResults(writer, paragraph.Lines, visualParent2);
            LayoutDump.DumpParagraphResults(writer, "Floaters", paragraph.Floaters, visualParent2);
            LayoutDump.DumpParagraphResults(writer, "Figures", paragraph.Figures, visualParent2);
            writer.WriteEndElement();
        }
Пример #2
0
        // Token: 0x0600650B RID: 25867 RVA: 0x001C5A58 File Offset: 0x001C3C58
        private static bool DumpText(XmlTextWriter writer, UIElement element, bool uiElementsOnly)
        {
            TextBlock textBlock = element as TextBlock;

            if (textBlock.HasComplexContent)
            {
                LayoutDump.DumpTextRange(writer, textBlock.ContentStart, textBlock.ContentEnd);
            }
            else
            {
                LayoutDump.DumpTextRange(writer, textBlock.Text);
            }
            writer.WriteStartElement("Metrics");
            writer.WriteAttributeString("BaselineOffset", ((double)textBlock.GetValue(TextBlock.BaselineOffsetProperty)).ToString("F", CultureInfo.InvariantCulture));
            writer.WriteEndElement();
            if (textBlock.IsLayoutDataValid)
            {
                ReadOnlyCollection <LineResult> lineResults = textBlock.GetLineResults();
                LayoutDump.DumpLineResults(writer, lineResults, element);
            }
            return(false);
        }