/// <summary> /// Sets and opens new url. /// </summary> /// <param name="url">The new url.</param> /// <param name="callback">The callback function when load completed.</param> protected internal void SetUrl(string url, WebBrowserCallback callback = null) { if (this.InvokeRequired) { this.Invoke(new Action <string, WebBrowserCallback>(SetUrl), url, callback); return; } Debug.WriteLine(String.Format("SetUrl {0}", url), "LoginForm"); this.Timeout = false; this.timer1.Enabled = false; this.ShowProgress(); this.Callback = callback; this.webBrowser1.Navigate(url); }
/// <summary> /// Sets and opens new url. /// </summary> /// <param name="url">The new url.</param> /// <param name="callback">The callback function when load completed.</param> protected internal void SetUrl(string url, WebBrowserCallback callback = null) { if (this.InvokeRequired) { this.Invoke(new Action <string, WebBrowserCallback>(SetUrl), url, callback); return; } Debug.WriteLine(String.Format("SetUrl {0}", url), "LoginForm"); this.Timeout = false; this.timer1.Enabled = false; this.ShowProgress(); this.Callback = callback; // Aguarda 300 milisegundos para garantir a nĂ£o-concorrĂªncia dentro do Navigate Thread.Sleep(300); this.webBrowser1.Navigate(url); }