Esempio n. 1
0
        private void HacerBuesqueda()
        {
            if (ToolStripTextBoxURL.TextLength > 2)
            {
                try
                {
                    Mutex mutex = new Mutex();
                    WebBrowserPrincipal.Navigating += WebBrowserPrincipal_Navigating;
                    if (Contenedor.Cache.Get(ToolStripTextBoxURL.Text) == null)
                    {
                        WebBrowserPrincipal.Navigate(ToolStripTextBoxURL.Text);
                        WebBrowserPrincipal.DocumentCompleted += WebBrowserPrincipal_DocumentCompleted;
                        URL = ToolStripTextBoxURL.Text;
                    }
                    else
                    {
                        mutex.WaitOne();
                        WebBrowserPrincipal.DocumentStream     = (Stream)Contenedor.Cache.Get(ToolStripTextBoxURL.Text);
                        WebBrowserPrincipal.DocumentCompleted += WebBrowserPrincipal_DocumentCompleted1;;
                        mutex.ReleaseMutex();
                    }


                    mutex.WaitOne();
                    Thread.Sleep(50);
                    Contenedor.Busqueda     = ToolStripTextBoxURL.Text;
                    Contenedor.BusquedaEcha = true;
                    Thread.Sleep(50);
                    mutex.ReleaseMutex();
                }
                catch (Exception ex)
                {
                }
            }
        }
Esempio n. 2
0
 private void HacerBuesqueda()
 {
     if (ToolStripTextBoxURL.TextLength > 2)
     {
         try
         {
             WebBrowserPrincipal.Navigate(ToolStripTextBoxURL.Text);
             Mutex mutex = new Mutex();
             mutex.WaitOne();
             Thread.Sleep(50);
             Contenedor.Busqueda     = ToolStripTextBoxURL.Text;
             Contenedor.BusquedaEcha = true;
             Thread.Sleep(50);
             mutex.ReleaseMutex();
         }
         catch (Exception ex)
         {
         }
     }
 }