// Token: 0x06002D1C RID: 11548 RVA: 0x000CB9FB File Offset: 0x000C9BFB internal FixedElement(FixedElement.ElementType type, FixedTextPointer start, FixedTextPointer end, int pageIndex) { this._type = type; this._start = start; this._end = end; this._pageIndex = pageIndex; }
// Token: 0x06002EA8 RID: 11944 RVA: 0x000D2E3C File Offset: 0x000D103C internal void OnNewFlowElement(FixedElement parentElement, FixedElement.ElementType elementType, FlowPosition pStart, FlowPosition pEnd, object source, int pageIndex) { FixedTextPointer start = new FixedTextPointer(false, LogicalDirection.Backward, pStart); FixedTextPointer end = new FixedTextPointer(false, LogicalDirection.Forward, pEnd); FixedElement fixedElement = new FixedElement(elementType, start, end, pageIndex); if (source != null) { fixedElement.Object = source; } parentElement.Append(fixedElement); pStart.AttachElement(fixedElement); pEnd.AttachElement(fixedElement); }
internal void OnNewFlowElement(FixedElement parentElement, FixedElement.ElementType elementType, FlowPosition pStart, FlowPosition pEnd, Object source, int pageIndex) { FixedTextPointer eStart = new FixedTextPointer(false, LogicalDirection.Backward, pStart); FixedTextPointer eEnd = new FixedTextPointer(false, LogicalDirection.Forward, pEnd); FixedElement e = new FixedElement(elementType, eStart, eEnd, pageIndex); if (source != null) { e.Object = source; } // hook up logical tree parentElement.Append(e); // attach element to flownode for faster lookup later. pStart.AttachElement(e); pEnd.AttachElement(e); }
// Token: 0x06002D1F RID: 11551 RVA: 0x000CBAC0 File Offset: 0x000C9CC0 internal object BuildObjectTree() { FixedElement.ElementType type = this._type; IAddChild addChild; if (type != FixedElement.ElementType.Paragraph) { switch (type) { case FixedElement.ElementType.Table: addChild = new Table(); goto IL_C7; case FixedElement.ElementType.TableRowGroup: addChild = new TableRowGroup(); goto IL_C7; case FixedElement.ElementType.TableRow: addChild = new TableRow(); goto IL_C7; case FixedElement.ElementType.TableCell: addChild = new TableCell(); goto IL_C7; case FixedElement.ElementType.Hyperlink: { Hyperlink hyperlink = new Hyperlink(); hyperlink.NavigateUri = (base.GetValue(FixedElement.NavigateUriProperty) as Uri); hyperlink.RequestNavigate += this.ClickHyperlink; AutomationProperties.SetHelpText(hyperlink, (string)base.GetValue(FixedElement.HelpTextProperty)); AutomationProperties.SetName(hyperlink, (string)base.GetValue(FixedElement.NameProperty)); addChild = hyperlink; goto IL_C7; } } addChild = null; } else { addChild = new Paragraph(); } IL_C7: ITextPointer textPointer = ((ITextPointer)this._start).CreatePointer(); while (textPointer.CompareTo(this._end) < 0) { TextPointerContext pointerContext = textPointer.GetPointerContext(LogicalDirection.Forward); if (pointerContext == TextPointerContext.Text) { addChild.AddText(textPointer.GetTextInRun(LogicalDirection.Forward)); } else if (pointerContext == TextPointerContext.EmbeddedElement) { addChild.AddChild(textPointer.GetAdjacentElement(LogicalDirection.Forward)); } else if (pointerContext == TextPointerContext.ElementStart) { object adjacentElement = textPointer.GetAdjacentElement(LogicalDirection.Forward); if (adjacentElement != null) { addChild.AddChild(adjacentElement); textPointer.MoveToNextContextPosition(LogicalDirection.Forward); textPointer.MoveToElementEdge(ElementEdge.BeforeEnd); } } textPointer.MoveToNextContextPosition(LogicalDirection.Forward); } return(addChild); }