// Token: 0x060064FD RID: 25853 RVA: 0x001C53D3 File Offset: 0x001C35D3 internal static void DumpLayoutTree(XmlTextWriter writer, string tagName, UIElement root) { writer.WriteStartElement(tagName); LayoutDump.DumpUIElement(writer, root, root, true); writer.WriteEndElement(); writer.WriteRaw("\r\n"); }
// Token: 0x060064FA RID: 25850 RVA: 0x001C5337 File Offset: 0x001C3537 internal static void DumpLayoutAndVisualTree(XmlTextWriter writer, string tagName, Visual root) { writer.WriteStartElement(tagName); LayoutDump.DumpVisual(writer, root, root); writer.WriteEndElement(); writer.WriteRaw("\r\n"); }
// Token: 0x06006502 RID: 25858 RVA: 0x001C5614 File Offset: 0x001C3814 internal static void DumpDocumentPage(XmlTextWriter writer, DocumentPage page, Visual parent) { writer.WriteStartElement("DocumentPage"); writer.WriteAttributeString("Type", page.GetType().FullName); if (page != DocumentPage.Missing) { LayoutDump.DumpSize(writer, "Size", page.Size); GeneralTransform generalTransform = page.Visual.TransformToAncestor(parent); Point point = new Point(0.0, 0.0); generalTransform.TryTransform(point, out point); if (point.X != 0.0 || point.Y != 0.0) { LayoutDump.DumpPoint(writer, "Position", point); } Type type = page.GetType(); LayoutDump.DumpCustomDocumentPage dumpCustomDocumentPage = null; while (dumpCustomDocumentPage == null && type != null) { dumpCustomDocumentPage = (LayoutDump._documentPageToDumpHandler[type] as LayoutDump.DumpCustomDocumentPage); type = type.BaseType; } if (dumpCustomDocumentPage != null) { dumpCustomDocumentPage(writer, page); } } writer.WriteEndElement(); }
// Token: 0x0600650D RID: 25869 RVA: 0x001C5B40 File Offset: 0x001C3D40 private static bool DumpFlowDocumentView(XmlTextWriter writer, UIElement element, bool uiElementsOnly) { FlowDocumentView flowDocumentView = element as FlowDocumentView; IScrollInfo scrollInfo = flowDocumentView; if (scrollInfo.ScrollOwner != null) { Size size = new Size(scrollInfo.ExtentWidth, scrollInfo.ExtentHeight); if (DoubleUtil.AreClose(size, element.DesiredSize)) { LayoutDump.DumpSize(writer, "Extent", size); } Point point = new Point(scrollInfo.HorizontalOffset, scrollInfo.VerticalOffset); if (!DoubleUtil.IsZero(point.X) || !DoubleUtil.IsZero(point.Y)) { LayoutDump.DumpPoint(writer, "Offset", point); } } FlowDocumentPage documentPage = flowDocumentView.Document.BottomlessFormatter.DocumentPage; GeneralTransform generalTransform = documentPage.Visual.TransformToAncestor(flowDocumentView); Point point2 = new Point(0.0, 0.0); generalTransform.TryTransform(point2, out point2); if (!DoubleUtil.IsZero(point2.X) && !DoubleUtil.IsZero(point2.Y)) { LayoutDump.DumpPoint(writer, "PagePosition", point2); } LayoutDump.DumpFlowDocumentPage(writer, documentPage); return(false); }
// Token: 0x06006500 RID: 25856 RVA: 0x001C5414 File Offset: 0x001C3614 internal static void DumpVisual(XmlTextWriter writer, Visual visual, Visual parent) { if (visual is UIElement) { LayoutDump.DumpUIElement(writer, (UIElement)visual, parent, false); return; } writer.WriteStartElement(visual.GetType().Name); Rect visualContentBounds = visual.VisualContentBounds; if (!visualContentBounds.IsEmpty) { LayoutDump.DumpRect(writer, "ContentRect", visualContentBounds); } Geometry clip = VisualTreeHelper.GetClip(visual); if (clip != null) { LayoutDump.DumpRect(writer, "Clip.Bounds", clip.Bounds); } GeneralTransform generalTransform = visual.TransformToAncestor(parent); Point point = new Point(0.0, 0.0); generalTransform.TryTransform(point, out point); if (point.X != 0.0 || point.Y != 0.0) { LayoutDump.DumpPoint(writer, "Position", point); } LayoutDump.DumpVisualChildren(writer, "Children", visual); writer.WriteEndElement(); }
// Token: 0x06006509 RID: 25865 RVA: 0x001C5984 File Offset: 0x001C3B84 static LayoutDump() { LayoutDump.AddUIElementDumpHandler(typeof(TextBlock), new LayoutDump.DumpCustomUIElement(LayoutDump.DumpText)); LayoutDump.AddUIElementDumpHandler(typeof(FlowDocumentScrollViewer), new LayoutDump.DumpCustomUIElement(LayoutDump.DumpFlowDocumentScrollViewer)); LayoutDump.AddUIElementDumpHandler(typeof(FlowDocumentView), new LayoutDump.DumpCustomUIElement(LayoutDump.DumpFlowDocumentView)); LayoutDump.AddUIElementDumpHandler(typeof(DocumentPageView), new LayoutDump.DumpCustomUIElement(LayoutDump.DumpDocumentPageView)); LayoutDump.AddDocumentPageDumpHandler(typeof(FlowDocumentPage), new LayoutDump.DumpCustomDocumentPage(LayoutDump.DumpFlowDocumentPage)); }
// Token: 0x060064FB RID: 25851 RVA: 0x001C535C File Offset: 0x001C355C internal static void DumpLayoutTreeToFile(string tagName, UIElement root, string fileName) { string value = LayoutDump.DumpLayoutTreeToString(tagName, root); StreamWriter streamWriter = new StreamWriter(fileName); streamWriter.Write(value); streamWriter.Flush(); streamWriter.Close(); }
// Token: 0x0600650A RID: 25866 RVA: 0x001C5A2C File Offset: 0x001C3C2C private static bool DumpDocumentPageView(XmlTextWriter writer, UIElement element, bool uiElementsOnly) { DocumentPageView documentPageView = element as DocumentPageView; if (documentPageView.DocumentPage != null) { LayoutDump.DumpDocumentPage(writer, documentPageView.DocumentPage, element); } return(false); }
// Token: 0x06006517 RID: 25879 RVA: 0x001C6140 File Offset: 0x001C4340 private static void DumpUIElementParagraphResult(XmlTextWriter writer, UIElementParagraphResult paragraph, Visual visualParent) { writer.WriteStartElement("BlockUIContainer"); writer.WriteStartElement("Element"); writer.WriteAttributeString("Type", paragraph.Element.GetType().FullName); writer.WriteEndElement(); LayoutDump.DumpRect(writer, "LayoutBox", paragraph.LayoutBox); Visual visual = LayoutDump.DumpParagraphOffset(writer, paragraph, visualParent); writer.WriteEndElement(); }
// Token: 0x0600651A RID: 25882 RVA: 0x001C62C0 File Offset: 0x001C44C0 private static void DumpSubpageParagraphResult(XmlTextWriter writer, SubpageParagraphResult paragraph, Visual visualParent) { writer.WriteStartElement("SubpageParagraph"); 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.DumpColumnResults(writer, paragraph.Columns, visualParent2); writer.WriteEndElement(); }
// Token: 0x060064FC RID: 25852 RVA: 0x001C538C File Offset: 0x001C358C internal static string DumpLayoutTreeToString(string tagName, UIElement root) { StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture); XmlTextWriter xmlTextWriter = new XmlTextWriter(stringWriter); xmlTextWriter.Formatting = Formatting.Indented; xmlTextWriter.Indentation = 2; LayoutDump.DumpLayoutTree(xmlTextWriter, tagName, root); xmlTextWriter.Flush(); xmlTextWriter.Close(); return(stringWriter.ToString()); }
// Token: 0x0600650E RID: 25870 RVA: 0x001C5C3C File Offset: 0x001C3E3C private static void DumpFlowDocumentPage(XmlTextWriter writer, DocumentPage page) { FlowDocumentPage flowDocumentPage = page as FlowDocumentPage; writer.WriteStartElement("FormattedLines"); writer.WriteAttributeString("Count", flowDocumentPage.FormattedLinesCount.ToString(CultureInfo.InvariantCulture)); writer.WriteEndElement(); TextDocumentView textDocumentView = (TextDocumentView)((IServiceProvider)flowDocumentPage).GetService(typeof(ITextView)); if (textDocumentView.IsValid) { LayoutDump.DumpColumnResults(writer, textDocumentView.Columns, page.Visual); } }
// 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(); }
// Token: 0x06006503 RID: 25859 RVA: 0x001C5700 File Offset: 0x001C3900 private static void DumpVisualChildren(XmlTextWriter writer, string tagName, Visual visualParent) { int childrenCount = VisualTreeHelper.GetChildrenCount(visualParent); if (childrenCount > 0) { writer.WriteStartElement(tagName); writer.WriteAttributeString("Count", childrenCount.ToString(CultureInfo.InvariantCulture)); for (int i = 0; i < childrenCount; i++) { LayoutDump.DumpVisual(writer, visualParent.InternalGetVisualChild(i), visualParent); } writer.WriteEndElement(); } }
// Token: 0x0600650C RID: 25868 RVA: 0x001C5AEC File Offset: 0x001C3CEC private static bool DumpFlowDocumentScrollViewer(XmlTextWriter writer, UIElement element, bool uiElementsOnly) { FlowDocumentScrollViewer flowDocumentScrollViewer = element as FlowDocumentScrollViewer; bool result = false; if (flowDocumentScrollViewer.HorizontalScrollBarVisibility == ScrollBarVisibility.Hidden && flowDocumentScrollViewer.VerticalScrollBarVisibility == ScrollBarVisibility.Hidden && flowDocumentScrollViewer.ScrollViewer != null) { FlowDocumentView flowDocumentView = flowDocumentScrollViewer.ScrollViewer.Content as FlowDocumentView; if (flowDocumentView != null) { LayoutDump.DumpUIElement(writer, flowDocumentView, flowDocumentScrollViewer, uiElementsOnly); result = true; } } return(result); }
// Token: 0x06006504 RID: 25860 RVA: 0x001C5758 File Offset: 0x001C3958 internal static void DumpUIElementChildren(XmlTextWriter writer, string tagName, Visual visualParent) { List <UIElement> list = new List <UIElement>(); LayoutDump.GetUIElementsFromVisual(visualParent, list); if (list.Count > 0) { writer.WriteStartElement(tagName); writer.WriteAttributeString("Count", list.Count.ToString(CultureInfo.InvariantCulture)); for (int i = 0; i < list.Count; i++) { LayoutDump.DumpUIElement(writer, list[i], visualParent, true); } writer.WriteEndElement(); } }
// Token: 0x06006508 RID: 25864 RVA: 0x001C593C File Offset: 0x001C3B3C internal static void GetUIElementsFromVisual(Visual visual, List <UIElement> uiElements) { int childrenCount = VisualTreeHelper.GetChildrenCount(visual); for (int i = 0; i < childrenCount; i++) { Visual visual2 = visual.InternalGetVisualChild(i); if (visual2 is UIElement) { uiElements.Add((UIElement)visual2); } else { LayoutDump.GetUIElementsFromVisual(visual2, uiElements); } } }
// Token: 0x06006512 RID: 25874 RVA: 0x001C5E10 File Offset: 0x001C4010 private static void DumpLineResults(XmlTextWriter writer, ReadOnlyCollection <LineResult> lines, Visual visualParent) { if (lines != null) { writer.WriteStartElement("Lines"); writer.WriteAttributeString("Count", lines.Count.ToString(CultureInfo.InvariantCulture)); for (int i = 0; i < lines.Count; i++) { writer.WriteStartElement("Line"); LineResult lineResult = lines[i]; LayoutDump.DumpRect(writer, "LayoutBox", lineResult.LayoutBox); LayoutDump.DumpLineRange(writer, lineResult.StartPositionCP, lineResult.EndPositionCP, lineResult.GetContentEndPositionCP(), lineResult.GetEllipsesPositionCP()); writer.WriteEndElement(); } writer.WriteEndElement(); } }
// Token: 0x06006501 RID: 25857 RVA: 0x001C54F0 File Offset: 0x001C36F0 private static void DumpUIElement(XmlTextWriter writer, UIElement element, Visual parent, bool uiElementsOnly) { writer.WriteStartElement(element.GetType().Name); LayoutDump.DumpSize(writer, "DesiredSize", element.DesiredSize); LayoutDump.DumpSize(writer, "ComputedSize", element.RenderSize); Geometry clip = VisualTreeHelper.GetClip(element); if (clip != null) { LayoutDump.DumpRect(writer, "Clip.Bounds", clip.Bounds); } GeneralTransform generalTransform = element.TransformToAncestor(parent); Point point = new Point(0.0, 0.0); generalTransform.TryTransform(point, out point); if (point.X != 0.0 || point.Y != 0.0) { LayoutDump.DumpPoint(writer, "Position", point); } bool flag = false; Type type = element.GetType(); LayoutDump.DumpCustomUIElement dumpCustomUIElement = null; while (dumpCustomUIElement == null && type != null) { dumpCustomUIElement = (LayoutDump._elementToDumpHandler[type] as LayoutDump.DumpCustomUIElement); type = type.BaseType; } if (dumpCustomUIElement != null) { flag = dumpCustomUIElement(writer, element, uiElementsOnly); } if (!flag) { if (uiElementsOnly) { LayoutDump.DumpUIElementChildren(writer, "Children", element); } else { LayoutDump.DumpVisualChildren(writer, "Children", element); } } writer.WriteEndElement(); }
// Token: 0x0600651B RID: 25883 RVA: 0x001C6334 File Offset: 0x001C4534 private static void DumpColumnResults(XmlTextWriter writer, ReadOnlyCollection <ColumnResult> columns, Visual visualParent) { if (columns != null) { writer.WriteStartElement("Columns"); writer.WriteAttributeString("Count", columns.Count.ToString(CultureInfo.InvariantCulture)); for (int i = 0; i < columns.Count; i++) { writer.WriteStartElement("Column"); ColumnResult columnResult = columns[i]; LayoutDump.DumpRect(writer, "LayoutBox", columnResult.LayoutBox); LayoutDump.DumpTextRange(writer, columnResult.StartPosition, columnResult.EndPosition); LayoutDump.DumpParagraphResults(writer, "Paragraphs", columnResult.Paragraphs, visualParent); writer.WriteEndElement(); } writer.WriteEndElement(); } }
// Token: 0x06006513 RID: 25875 RVA: 0x001C5EAC File Offset: 0x001C40AC private static void DumpParagraphResults(XmlTextWriter writer, string tagName, ReadOnlyCollection <ParagraphResult> paragraphs, Visual visualParent) { if (paragraphs != null) { writer.WriteStartElement(tagName); writer.WriteAttributeString("Count", paragraphs.Count.ToString(CultureInfo.InvariantCulture)); for (int i = 0; i < paragraphs.Count; i++) { ParagraphResult paragraphResult = paragraphs[i]; if (paragraphResult is TextParagraphResult) { LayoutDump.DumpTextParagraphResult(writer, (TextParagraphResult)paragraphResult, visualParent); } else if (paragraphResult is ContainerParagraphResult) { LayoutDump.DumpContainerParagraphResult(writer, (ContainerParagraphResult)paragraphResult, visualParent); } else if (paragraphResult is TableParagraphResult) { LayoutDump.DumpTableParagraphResult(writer, (TableParagraphResult)paragraphResult, visualParent); } else if (paragraphResult is FloaterParagraphResult) { LayoutDump.DumpFloaterParagraphResult(writer, (FloaterParagraphResult)paragraphResult, visualParent); } else if (paragraphResult is UIElementParagraphResult) { LayoutDump.DumpUIElementParagraphResult(writer, (UIElementParagraphResult)paragraphResult, visualParent); } else if (paragraphResult is FigureParagraphResult) { LayoutDump.DumpFigureParagraphResult(writer, (FigureParagraphResult)paragraphResult, visualParent); } else if (paragraphResult is SubpageParagraphResult) { LayoutDump.DumpSubpageParagraphResult(writer, (SubpageParagraphResult)paragraphResult, visualParent); } } writer.WriteEndElement(); } }
// Token: 0x0600651C RID: 25884 RVA: 0x001C63D8 File Offset: 0x001C45D8 private static Visual DumpParagraphOffset(XmlTextWriter writer, ParagraphResult paragraph, Visual visualParent) { Type type = paragraph.GetType(); FieldInfo field = type.GetField("_paraClient", BindingFlags.Instance | BindingFlags.NonPublic); object value = field.GetValue(paragraph); Type type2 = value.GetType(); PropertyInfo property = type2.GetProperty("Visual", BindingFlags.Instance | BindingFlags.NonPublic); Visual visual = (Visual)property.GetValue(value, null); if (visualParent.IsAncestorOf(visual)) { GeneralTransform generalTransform = visual.TransformToAncestor(visualParent); Point point = new Point(0.0, 0.0); generalTransform.TryTransform(point, out point); if (point.X != 0.0 || point.Y != 0.0) { LayoutDump.DumpPoint(writer, "Origin", point); } } return(visual); }
// Token: 0x06006519 RID: 25881 RVA: 0x001C6218 File Offset: 0x001C4418 private static void DumpTableParagraphResult(XmlTextWriter writer, TableParagraphResult paragraph, Visual visualParent) { writer.WriteStartElement("TableParagraph"); LayoutDump.DumpRect(writer, "LayoutBox", paragraph.LayoutBox); Visual visual = LayoutDump.DumpParagraphOffset(writer, paragraph, visualParent); ReadOnlyCollection <ParagraphResult> paragraphs = paragraph.Paragraphs; int childrenCount = VisualTreeHelper.GetChildrenCount(visual); for (int i = 0; i < childrenCount; i++) { Visual visual2 = visual.InternalGetVisualChild(i); int childrenCount2 = VisualTreeHelper.GetChildrenCount(visual2); ReadOnlyCollection <ParagraphResult> cellParagraphs = ((RowParagraphResult)paragraphs[i]).CellParagraphs; for (int j = 0; j < childrenCount2; j++) { Visual cellVisual = visual2.InternalGetVisualChild(j); LayoutDump.DumpTableCell(writer, cellParagraphs[j], cellVisual, visual); } } writer.WriteEndElement(); }
// 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); }
// Token: 0x0600651E RID: 25886 RVA: 0x001C64F8 File Offset: 0x001C46F8 private static void DumpTableCell(XmlTextWriter writer, ParagraphResult paragraph, Visual cellVisual, Visual tableVisual) { Type type = paragraph.GetType(); FieldInfo field = type.GetField("_paraClient", BindingFlags.Instance | BindingFlags.NonPublic); if (field == null) { return; } CellParaClient cellParaClient = (CellParaClient)field.GetValue(paragraph); CellParagraph cellParagraph = cellParaClient.CellParagraph; TableCell cell = cellParagraph.Cell; writer.WriteStartElement("Cell"); Type type2 = cell.GetType(); PropertyInfo property = type2.GetProperty("ColumnIndex", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.NonPublic); if (property != null) { writer.WriteAttributeString("ColumnIndex", ((int)property.GetValue(cell, null)).ToString(CultureInfo.InvariantCulture)); } PropertyInfo property2 = type2.GetProperty("RowIndex", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.NonPublic); if (property2 != null) { writer.WriteAttributeString("RowIndex", ((int)property2.GetValue(cell, null)).ToString(CultureInfo.InvariantCulture)); } writer.WriteAttributeString("ColumnSpan", cell.ColumnSpan.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("RowSpan", cell.RowSpan.ToString(CultureInfo.InvariantCulture)); Rect rect = cellParaClient.Rect.FromTextDpi(); LayoutDump.DumpRect(writer, "LayoutBox", rect); bool flag; LayoutDump.DumpParagraphResults(writer, "Paragraphs", cellParaClient.GetColumnResults(out flag)[0].Paragraphs, cellParaClient.Visual); writer.WriteEndElement(); }