Esempio n. 1
0
 private void WebBrowser_AddressChanged(object sender, CefSharp.AddressChangedEventArgs e)
 {
     Invoke((MethodInvoker) delegate
     {
         AddressBar.Text = e.Address;
     });
 }
Esempio n. 2
0
 // If the browser's address got changed..
 private void Browser_AddressChanged(object sender, CefSharp.AddressChangedEventArgs e)
 {
     if (this.IsHandleCreated)                    // an exception might occur: "Invoke or BeginInvoke cannot be called on a control until the window handle has been created."
     {
         this.Invoke(new MethodInvoker(delegate() // Set the URL text and button states with an invoke call as the browser runs in a different thread..
         {
             lbUrl.Text = e.Address;
             SetButtonStates(); // sets the button states to enabled / disabled depending on the browser component's state..
         }
                                       ));
     }
 }
Esempio n. 3
0
        private void WbMain_AddressChanged(object sender, CefSharp.AddressChangedEventArgs e)
        {
            if (e.Address.Contains("access_token"))
            {
                string sideWithAccessToken  = e.Address.Split('#').Where(k => k.Contains("access_token")).FirstOrDefault();
                string accessTokenParameter = sideWithAccessToken.Split('&').Where(k => k.Contains("access_token")).FirstOrDefault();
                string accessToken          = accessTokenParameter.Split('=').Where(k => !k.Contains("access_token")).FirstOrDefault();

                InitializeApi(accessToken);

                this.Invoke((Action) delegate
                {
                    txtAccessToken.Text = accessToken;
                });
            }
        }
Esempio n. 4
0
 private void Browser_AddressChanged(object sender, CefSharp.AddressChangedEventArgs e)
 {
     atualizarInfo = true;
     UriAtual      = e.Address;
 }