// 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); }
internal ColumnResult(FlowDocumentPage page, ref PTS.FSTRACKDESCRIPTION trackDesc, Vector contentOffset) { this._page = page; this._columnHandle = trackDesc.pfstrack; this._layoutBox = new Rect(TextDpi.FromTextDpi(trackDesc.fsrc.u), TextDpi.FromTextDpi(trackDesc.fsrc.v), TextDpi.FromTextDpi(trackDesc.fsrc.du), TextDpi.FromTextDpi(trackDesc.fsrc.dv)); this._layoutBox.X = this._layoutBox.X + contentOffset.X; this._layoutBox.Y = this._layoutBox.Y + contentOffset.Y; this._columnOffset = new Vector(TextDpi.FromTextDpi(trackDesc.fsrc.u), TextDpi.FromTextDpi(trackDesc.fsrc.v)); this._hasTextContent = false; }
// Token: 0x06007027 RID: 28711 RVA: 0x00203768 File Offset: 0x00201968 private DocumentPage FormatPage(int pageNumber) { Invariant.Assert(this._brt.HasPageBreakRecord(pageNumber), "BreakRecord for specified page number does not exist."); PageBreakRecord pageBreakRecord = this._brt.GetPageBreakRecord(pageNumber); FlowDocumentPage flowDocumentPage = new FlowDocumentPage(this._document.StructuralCache); Size size = this.ComputePageSize(); Thickness pageMargin = this._document.ComputePageMargin(); PageBreakRecord brOut = flowDocumentPage.FormatFinite(size, pageMargin, pageBreakRecord); flowDocumentPage.Arrange(size); this._brt.UpdateEntry(pageNumber, flowDocumentPage, brOut, flowDocumentPage.DependentMax); return(flowDocumentPage); }
// 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); } }
// ------------------------------------------------------------------ // Dump FlowDocumentPage specific data. // ------------------------------------------------------------------ private static void DumpFlowDocumentPage(XmlTextWriter writer, DocumentPage page) { FlowDocumentPage flowDocumentPage = page as FlowDocumentPage; Debug.Assert(flowDocumentPage != null, "Dump function has to match page type."); // Dump private info. writer.WriteStartElement("FormattedLines"); writer.WriteAttributeString("Count", flowDocumentPage.FormattedLinesCount.ToString(CultureInfo.InvariantCulture)); writer.WriteEndElement(); // Dump columns collection TextDocumentView tv = (TextDocumentView)((IServiceProvider)flowDocumentPage).GetService(typeof(ITextView)); if (tv.IsValid) { DumpColumnResults(writer, tv.Columns, page.Visual); } }
// Token: 0x06007013 RID: 28691 RVA: 0x002032D4 File Offset: 0x002014D4 public override ContentPosition GetPagePosition(DocumentPage page) { this._dispatcherObject.VerifyAccess(); if (page == null) { throw new ArgumentNullException("page"); } FlowDocumentPage flowDocumentPage = page as FlowDocumentPage; if (flowDocumentPage == null || flowDocumentPage.IsDisposed) { return(ContentPosition.Missing); } Point point = new Point(0.0, 0.0); if (this._document.FlowDirection == FlowDirection.RightToLeft) { MatrixTransform matrixTransform = new MatrixTransform(-1.0, 0.0, 0.0, 1.0, flowDocumentPage.Size.Width, 0.0); Point point2; matrixTransform.TryTransform(point, out point2); point = point2; } ITextView textView = (ITextView)((IServiceProvider)flowDocumentPage).GetService(typeof(ITextView)); Invariant.Assert(textView != null, "Cannot access ITextView for FlowDocumentPage."); if (textView.TextSegments.Count == 0) { return(ContentPosition.Missing); } ITextPointer textPointer = textView.GetTextPositionFromPoint(point, true); if (textPointer == null) { textPointer = textView.TextSegments[0].Start; } if (!(textPointer is TextPointer)) { return(ContentPosition.Missing); } return((ContentPosition)textPointer); }
/// <summary> /// Format the page identified by the pageNumber parameter. /// </summary> private DocumentPage FormatPage(int pageNumber) { FlowDocumentPage page; PageBreakRecord breakRecordIn, breakRecordOut; Thickness pageMargin; Size pageSize; Invariant.Assert(_brt.HasPageBreakRecord(pageNumber), "BreakRecord for specified page number does not exist."); breakRecordIn = _brt.GetPageBreakRecord(pageNumber); page = new FlowDocumentPage(_document.StructuralCache); pageSize = ComputePageSize(); pageMargin = _document.ComputePageMargin(); breakRecordOut = page.FormatFinite(pageSize, pageMargin, breakRecordIn); page.Arrange(pageSize); // NOTE: May execute external code, so it is possible to get // an exception here. _brt.UpdateEntry(pageNumber, page, breakRecordOut, page.DependentMax); return(page); }
// ------------------------------------------------------------------ // Dump FlowDocumentView specific data. // ------------------------------------------------------------------ private static bool DumpFlowDocumentView(XmlTextWriter writer, UIElement element, bool uiElementsOnly) { FlowDocumentView fdView = element as FlowDocumentView; Debug.Assert(fdView != null, "Dump function has to match element type."); // Dump scrolling information IScrollInfo isi = (IScrollInfo)fdView; if (isi.ScrollOwner != null) { Size extent = new Size(isi.ExtentWidth, isi.ExtentHeight); if (DoubleUtil.AreClose(extent, element.DesiredSize)) { DumpSize(writer, "Extent", extent); } Point offset = new Point(isi.HorizontalOffset, isi.VerticalOffset); if (!DoubleUtil.IsZero(offset.X) || !DoubleUtil.IsZero(offset.Y)) { DumpPoint(writer, "Offset", offset); } } FlowDocumentPage documentPage = fdView.Document.BottomlessFormatter.DocumentPage; // Dump transform relative to its parent GeneralTransform gt = documentPage.Visual.TransformToAncestor(fdView); Point point = new Point(0, 0); gt.TryTransform(point, out point); if (!DoubleUtil.IsZero(point.X) && !DoubleUtil.IsZero(point.Y)) { DumpPoint(writer, "PagePosition", point); } DumpFlowDocumentPage(writer, documentPage); return(false); }
//------------------------------------------------------------------- // // Constructors // //------------------------------------------------------------------- #region Constructors /// <summary> /// Constructor /// </summary> internal FlowDocumentFormatter(FlowDocument document) { _document = document; _documentPage = new FlowDocumentPage(_document.StructuralCache); }