Пример #1
0
 /// <summary>
 /// Reloads page for current URL
 /// </summary>
 public void reload()
 {
     if (browser != null)
     {
         browser.Refresh(WebBrowserRefreshOption.Completely);
         do
         {
             // Run events while waiting
             Trifle.Wait(50);
         } while (loading);
     }
 }
Пример #2
0
 /// <summary>
 /// Stops loading the current page.
 /// </summary>
 public void stop()
 {
     if (browser != null)
     {
         browser.Stop();
         do
         {
             // Run events while waiting
             Trifle.Wait(50);
         } while (loading);
     }
 }
Пример #3
0
 /// <summary>
 /// Goes forward to next page in history
 /// </summary>
 public void goForward()
 {
     if (browser.CanGoForward)
     {
         browser.GoForward();
         do
         {
             // Run events while waiting
             Trifle.Wait(50);
         } while (loading);
     }
 }
Пример #4
0
 /// <summary>
 /// Goes back or forward through history
 /// </summary>
 /// <param name="index"></param>
 public void go(int index)
 {
     if (index != 0 && browser.History != null)
     {
         browser.History.Go(index);
         do
         {
             // Run events while waiting
             Trifle.Wait(50);
         } while (loading);
     }
 }
Пример #5
0
 /// <summary>
 /// Stops loading the current page.
 /// </summary>
 public void stop()
 {
     if (browser != null)
     {
         Console.debug("Stop!");
         browser.Stop();
         do
         {
             // Run events while waiting
             Trifle.Wait(50);
         } while (loading);
     }
 }
Пример #6
0
 /// <summary>
 /// Reloads page for current URL
 /// </summary>
 public void reload()
 {
     if (browser != null)
     {
         // Set navigation type
         this.navigationType = "Reload";
         browser.Refresh(WebBrowserRefreshOption.Completely);
         do
         {
             // Run events while waiting
             Trifle.Wait(50);
         } while (loading);
     }
 }
Пример #7
0
 /// <summary>
 /// Goes back or forward through history
 /// </summary>
 /// <param name="index"></param>
 public void go(int index)
 {
     if (index != 0 && browser.History != null)
     {
         // Set navigation type
         this.navigationType = "BackOrForward";
         browser.History.Go(index);
         do
         {
             // Run events while waiting
             Trifle.Wait(50);
         } while (loading);
     }
 }
Пример #8
0
 /// <summary>
 /// Goes forward to next page in history
 /// </summary>
 public void goForward()
 {
     if (browser.CanGoForward)
     {
         // Set navigation type
         this.navigationType = "BackOrForward";
         browser.GoForward();
         do
         {
             // Run events while waiting
             Trifle.Wait(50);
         } while (loading);
     }
 }
Пример #9
0
 /// <summary>
 /// Opens a HTTP listener on specific TCP bindings
 /// </summary>
 /// <param name="bindings"></param>
 /// <param name="callbackId"></param>
 public bool _listen(string uri, string callbackId)
 {
     // Start & Run HTTP daemon
     try
     {
         // Initialize URI for binding
         int port; Uri binding;
         if (Int32.TryParse(uri, out port))
         {
             binding = new Uri(String.Format("http://localhost:{0}/", port));
         }
         else if (!uri.Contains("http"))
         {
             binding = new Uri(String.Format("http//{0}", uri));
         }
         else
         {
             binding = new Uri(uri);
         }
         uri = binding.AbsoluteUri;
         // Already using binding? Replace it.
         if (processes.ContainsKey(uri))
         {
             processes[uri].Stop();
             processes.Remove(uri);
         }
         Process process = new Process(callbackId, uri);
         processes.Add(uri, process);
         this.port = binding.Port.ToString();
         Console.xdebug(String.Format("WebServer Listening on {0}", uri));
         // Wait for 10ms to allow first connection
         Trifle.Wait(10);
         return(true);
     }
     catch
     {
         return(false);
     }
 }