public override void InvokeUndo(InternalTextLayerController textLayer)
 {
     textLayer.CurrentLineNumber = startLineNumber;
     textLayer.TryMoveCaretTo(startCharIndex);
     textLayer.StartSelect();
     textLayer.CurrentLineNumber = endLineNumber;
     textLayer.TryMoveCaretTo(endCharIndex);
     textLayer.EndSelect();
 }
Beispiel #2
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 override void InvokeRedo(InternalTextLayerController textLayer)
 {
     textLayer.CurrentLineNumber = startLineNumber;
     textLayer.TryMoveCaretTo(startCharIndex);
     if (singleInsertTextRun != null)
     {
         textLayer.AddTextRunToCurrentLine(singleInsertTextRun);
     }
     else
     {
         textLayer.AddTextRunsToCurrentLine(insertingTextRuns);
     }
 }
Beispiel #4
0
        public void HandleDoubleClick(UIMouseEventArgs e)
        {
            internalTextLayerController.CancelSelect();
            EditableRun textRun = this.CurrentTextRun;

            if (textRun != null)
            {
                VisualPointInfo pointInfo          = internalTextLayerController.GetCurrentPointInfo();
                int             lineCharacterIndex = pointInfo.LineCharIndex;
                int             localselIndex      = pointInfo.RunLocalSelectedIndex;
                internalTextLayerController.TryMoveCaretTo(lineCharacterIndex - localselIndex - 1);
                internalTextLayerController.StartSelect();
                internalTextLayerController.TryMoveCaretTo(internalTextLayerController.CharIndex + textRun.CharacterCount);
                internalTextLayerController.EndSelect();
            }
        }
 public override void InvokeUndo(InternalTextLayerController textLayer)
 {
     textLayer.CurrentLineNumber = startLineNumber;
     textLayer.TryMoveCaretTo(startCharIndex);
     textLayer.AddCharToCurrentLine(c);
 }
 public override void InvokeRedo(InternalTextLayerController textLayer)
 {
     textLayer.CurrentLineNumber = startLineNumber;
     textLayer.TryMoveCaretTo(startCharIndex);
     textLayer.DoDelete();
 }