Ejemplo n.º 1
0
        /// <summary>
        /// Handles text navigation
        /// </summary>
        /// <param name="gotoItem">how to navigate</param>
        /// <returns>true on success</returns>
        public override bool Goto(GoToItem gotoItem)
        {
            Log.Debug("GoToItem=" + gotoItem.ToString());

            switch (gotoItem)
            {
            case GoToItem.TopOfDocument:
                Keyboard.Send(Keys.I);
                break;

            case GoToItem.PreviousParagaph:
                Keyboard.Send(Keys.M);
                break;

            case GoToItem.NextParagraph:
                Keyboard.Send(Keys.K);
                break;

            case GoToItem.PreviousSentence:
                Keyboard.Send(Keys.X);
                break;

            case GoToItem.NextSentence:
                Keyboard.Send(Keys.W);
                break;

            default:
                return(base.Goto(gotoItem));
            }

            return(true);
        }
Ejemplo n.º 2
0
        public void GotoLogItemWithDialog()
        {
            int      itemNumber   = 1;
            DateTime dateTime     = DateTime.Now;
            var      selectedItem = this.GetSelectedListItem();

            if (selectedItem != null)
            {
                itemNumber = selectedItem.Index + 1;
                if (owner.LogParser.DateIsParsed && selectedItem.LogItem.Date != DateTime.MinValue)
                {
                    dateTime = selectedItem.LogItem.Date;
                }
            }

            using (GoToItem dlg = new GoToItem(itemNumber, dateTime, owner.LogParser.DateIsParsed))
            {
                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    if (dlg.DateTimeSelected)
                    {
                        this.GoToLogItem(dlg.DateTime, true);
                    }
                    else
                    {
                        this.GoToLogItem(dlg.ItemNumber - 1, true);
                    }

                    this.Focus();
                }
            }
        }
Ejemplo n.º 3
0
        public CollectItemMethod() : base("Collect nearest item", new List <Task>())
        {
            FindNearestItem task1 = new FindNearestItem();
            GoToItem        task2 = new GoToItem();

            this.subTasks.Add(task1);
            this.subTasks.Add(task2);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Navigate text indicated by GotoItem
        /// </summary>
        /// <param name="gotoItem">How to navigate</param>
        /// <returns>true on success</returns>
        public virtual bool Goto(GoToItem gotoItem)
        {
            switch (gotoItem)
            {
            case GoToItem.TopOfDocument:
                handleGoToTop();
                break;

            case GoToItem.EndOfDocument:
                handleGoToBottom();
                break;

            case GoToItem.NextLine:
                handleGoToNextLine();
                break;

            case GoToItem.PreviousLine:
                handleGoToPrevLine();
                break;

            case GoToItem.NextCharacter:
                handleGoToNextChar();
                break;

            case GoToItem.PreviousCharacter:
                handleGoToPrevChar();
                break;

            case GoToItem.Home:
                handleGoToHome();
                break;

            case GoToItem.End:
                handleGoToEnd();
                break;

            case GoToItem.PreviousPage:
                handleGoToPrevPage();
                break;

            case GoToItem.NextPage:
                handleGoToNextPage();
                break;

            case GoToItem.PreviousWord:
                handleGoToPrevWord();
                break;

            case GoToItem.NextWord:
                handleGoToNextWord();
                break;
            }

            return(true);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Sets the cursor to the next/previous sentence/para
        /// </summary>
        /// <param name="gotoItem">navigation mode</param>
        /// <returns>true on success</returns>
        public override bool Goto(GoToItem gotoItem)
        {
            bool retVal = true;

            if (!isWordRunning())
            {
                return false;
            }

            _sync = true;
            lock (_wordNavigator)
            {
                switch (gotoItem)
                {
                    case GoToItem.NextParagraph:
                        retVal = _wordNavigator.GotoNextParagraph();
                        break;

                    case GoToItem.PreviousParagaph:
                        retVal = _wordNavigator.GotoPreviousParagraph();
                        break;

                    case GoToItem.NextSentence:
                        retVal = _wordNavigator.GotoNextSentence();
                        break;

                    case GoToItem.PreviousSentence:
                        retVal = _wordNavigator.GotoPreviousSentence();
                        break;

                    default:
                        retVal = base.Goto(gotoItem);
                        break;
                }
            }

            _sync = false;
            triggerTextChanged(this);
            return retVal;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Navigate text indicated by GotoItem
        /// </summary>
        /// <param name="gotoItem">How to navigate</param>
        /// <returns>true on success</returns>
        public virtual bool Goto(GoToItem gotoItem)
        {
            switch (gotoItem)
            {
                case GoToItem.TopOfDocument:
                    handleGoToTop();
                    break;

                case GoToItem.EndOfDocument:
                    handleGoToBottom();
                    break;

                case GoToItem.NextLine:
                    handleGoToNextLine();
                    break;

                case GoToItem.PreviousLine:
                    handleGoToPrevLine();
                    break;

                case GoToItem.NextCharacter:
                    handleGoToNextChar();
                    break;

                case GoToItem.PreviousCharacter:
                    handleGoToPrevChar();
                    break;

                case GoToItem.Home:
                    handleGoToHome();
                    break;

                case GoToItem.End:
                    handleGoToEnd();
                    break;

                case GoToItem.PreviousPage:
                    handleGoToPrevPage();
                    break;

                case GoToItem.NextPage:
                    handleGoToNextPage();
                    break;

                case GoToItem.PreviousWord:
                    handleGoToPrevWord();
                    break;

                case GoToItem.NextWord:
                    handleGoToNextWord();
                    break;
            }

            return true;
        }
        /// <summary>
        /// Handles text navigation
        /// </summary>
        /// <param name="gotoItem">how to navigate</param>
        /// <returns>true on success</returns>
        public override bool Goto(GoToItem gotoItem)
        {
            Log.Debug("GoToItem=" + gotoItem.ToString());

            switch (gotoItem)
            {
                case GoToItem.TopOfDocument:
                    Keyboard.Send(Keys.I);
                    break;

                case GoToItem.PreviousParagaph:
                    Keyboard.Send(Keys.M);
                    break;

                case GoToItem.NextParagraph:
                    Keyboard.Send(Keys.K);
                    break;

                case GoToItem.PreviousSentence:
                    Keyboard.Send(Keys.X);
                    break;

                case GoToItem.NextSentence:
                    Keyboard.Send(Keys.W);
                    break;

                default:
                    return base.Goto(gotoItem);
            }

            return true;
        }