GetCurrentPointInfo() public method

public GetCurrentPointInfo ( ) : EditableVisualPointInfo
return EditableVisualPointInfo
Example #1
0
        public void HandleDoubleClick(UIMouseEventArgs e)
        {
            internalTextLayerController.CancelSelect();
            EditableRun textRun = this.CurrentTextRun;

            if (textRun != null)
            {
                VisualPointInfo pointInfo          = internalTextLayerController.GetCurrentPointInfo();
                int             lineCharacterIndex = pointInfo.LineCharIndex;
                int             local_sel_Index    = pointInfo.RunLocalSelectedIndex;
                //default behaviour is select only a hit word under the caret
                //so ask the text layer to find a hit word
                int startAt, len;
                internalTextLayerController.FindUnderlyingWord(out startAt, out len);
                if (len > 0)
                {
                    InvalidateGraphicOfCurrentLineArea();
                    internalTextLayerController.TryMoveCaretTo(startAt, true);
                    internalTextLayerController.StartSelect();
                    internalTextLayerController.TryMoveCaretTo(startAt + len);
                    internalTextLayerController.EndSelect();


                    //internalTextLayerController.TryMoveCaretTo(lineCharacterIndex - local_sel_Index, true);
                    //internalTextLayerController.StartSelect();
                    //internalTextLayerController.TryMoveCaretTo(internalTextLayerController.CharIndex + textRun.CharacterCount);
                    //internalTextLayerController.EndSelect();

                    InvalidateGraphicOfCurrentLineArea();
                }
            }
        }
        public void OnDoubleClick(UIMouseEventArgs e)
        {
            internalTextLayerController.CancelSelect();
            EditableRun textRun = this.CurrentTextRun;

            if (textRun != null)
            {
                VisualPointInfo pointInfo          = internalTextLayerController.GetCurrentPointInfo();
                int             lineCharacterIndex = pointInfo.LineCharIndex;
                int             localselIndex      = pointInfo.LocalSelectedIndex;
                internalTextLayerController.CharIndex = lineCharacterIndex - localselIndex - 1;
                internalTextLayerController.StartSelect();
                internalTextLayerController.CharIndex += textRun.CharacterCount;
                internalTextLayerController.EndSelect();
            }
        }