Ejemplo n.º 1
0
        public override void OnDoubleClick(MouseButtonEventArgs e)
        {
            base.OnDoubleClick(e);

            Paragraph para = RowManager.CurrentParagraph;

            if (para == null)
            {
                return;
            }
            if (Environment.TickCount - lastDoubleClickTicks < 500)
            {
                // Select Paragraph
                SelStart  = para.PositionOffset;
                SelLength = para.Length - 1;
                RowManager.SetCursorAbsPosition(para.PositionOffset + para.Length - 1);
            }
            else
            {
                // Select Word
                RowManager.MovePrevWord();
                SelStart = para.PositionOffset + RowManager.CursorPosition;
                RowManager.MoveEndOfWord();
                SelLength = (para.PositionOffset + RowManager.CursorPosition) - SelStart;

                Invalidate();
                lastDoubleClickTicks = Environment.TickCount;
            }
        }