ACAT.Extensions.Default.AppAgents.TalkWindowAgent.TalkWindowContextMenu.handleQuickSearch C# (CSharp) Method

handleQuickSearch() private method

Takes text from the talk window and goes to the first hit found when a search is done.
private handleQuickSearch ( ) : void
return void
        private void handleQuickSearch()
        {
            String text = getTalkWindowText();
            if (!String.IsNullOrEmpty(text.Trim()))
            {
                if (Context.AppTalkWindowManager.IsTalkWindowVisible)
                {
                    Context.AppTalkWindowManager.ToggleTalkWindow();
                }

                _webSearch.QuickSearch(text);
            }
            else
            {
                DialogUtils.ShowTimedDialog(
                            PanelManager.Instance.GetCurrentPanel() as Form,
                            Resources.QuickSearch,
                            Resources.SearchTextIsEmpty);
            }
        }

Usage Example

            /// <summary>
            /// Executes the command
            /// </summary>
            /// <param name="handled">set to true if handled</param>
            /// <returns>true on success</returns>
            public override bool Execute(ref bool handled)
            {
                handled = true;

                switch (Command)
                {
                case "QuickSearch":
                    _menu.handleQuickSearch();
                    break;

                case "GoogleSearch":
                    _menu.handleGoogleSearch();
                    break;

                case "WikiSearch":
                    _menu.handleWikiSearch();
                    break;

                case "Volume":
                    DialogUtils.LaunchVolumeSettingsAgent();
                    break;

                case "SpeechControl":
                    _menu.handleSpeechControl();
                    _menu.commandDispatcher.Dispatch("CmdGoBack", ref handled);
                    break;

                case "talkWindowZoomMenu":
                    _menu.handleTalkWindowZoom();
                    break;

                default:
                    handled = false;
                    break;
                }

                return(true);
            }