Ejemplo n.º 1
0
        public void VisualSearch_UpdateSearchResult()
        {
            try
            {
                MyLog.Write("VisualSearch_UpdateSearchResult: Started");
                while (webElementExplorerStarted == true)
                {
                    if (!webElementExplorerThreadPaused)
                    {
                        try
                        {
                            if (!WebSpyBrowser.IsVisualSearchScriptInjected())
                            {
                                MyLog.Write("VisualSearch_UpdateSearchResult: Found the Visual search is not injected. Injecting");
                                WebSpyBrowser.InjectVisualSearch();
                            }

                            if (!webElementExplorerThreadPaused)
                            {
                                ProcessCommands();
                            }
                        }
                        catch (Exception e)
                        {
                            StopVisualSearch();
                            MyLog.Error("Visual search stopped:");
                            MyLog.Exception(e);
                        }
                    }
                    Thread.Sleep(VisualSearchQueryDelayMs);
                }
            }
            finally
            {
                StopVisualSearch();
                MyLog.Write("VisualSearch_UpdateSearchResult: Finished");
            }
        }