示例#1
0
        /// <summary>
        /// Set TextSelection.
        /// </summary>
        private object SetTextSelection(object arg)
        {
            ITextSelection newTextSelection = arg as ITextSelection;

            if (newTextSelection != null && Document != null && IsValidTextSelectionForDocument(newTextSelection, Document))
            {
                ITextSelection textSelection = Document.StructuralCache.TextContainer.TextSelection;
                if (textSelection != null)
                {
                    textSelection.SetCaretToPosition(newTextSelection.AnchorPosition, newTextSelection.MovingPosition.LogicalDirection, true, true);
                    textSelection.ExtendToPosition(newTextSelection.MovingPosition);
                }
            }
            return(null);
        }
示例#2
0
        // Token: 0x0600709E RID: 28830 RVA: 0x00204508 File Offset: 0x00202708
        private object SetTextSelection(object arg)
        {
            ITextSelection textSelection = arg as ITextSelection;

            if (textSelection != null && base.Document != null && this.IsValidTextSelectionForDocument(textSelection, base.Document))
            {
                ITextSelection textSelection2 = base.Document.StructuralCache.TextContainer.TextSelection;
                if (textSelection2 != null)
                {
                    textSelection2.SetCaretToPosition(textSelection.AnchorPosition, textSelection.MovingPosition.LogicalDirection, true, true);
                    textSelection2.ExtendToPosition(textSelection.MovingPosition);
                }
            }
            return(null);
        }
        // Token: 0x060070BD RID: 28861 RVA: 0x00204838 File Offset: 0x00202A38
        private object SetTextSelection(object arg)
        {
            ITextSelection textSelection = arg as ITextSelection;
            FlowDocument   flowDocument  = base.Document as FlowDocument;

            if (textSelection != null && flowDocument != null && textSelection.AnchorPosition != null && textSelection.AnchorPosition.TextContainer == flowDocument.StructuralCache.TextContainer)
            {
                ITextSelection textSelection2 = flowDocument.StructuralCache.TextContainer.TextSelection;
                if (textSelection2 != null)
                {
                    textSelection2.SetCaretToPosition(textSelection.AnchorPosition, textSelection.MovingPosition.LogicalDirection, true, true);
                    textSelection2.ExtendToPosition(textSelection.MovingPosition);
                }
            }
            return(null);
        }