示例#1
0
        private void OnWebViewNavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
        {
            this.Text = this._webView1.DocumentTitle;
#pragma warning disable 4014
            this._webView1.SetFavIconAsync(this);
#pragma warning restore 4014
        }
示例#2
0
 private void webView1_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
 {
     //Title = webView1.DocumentTitle;
     if (!e.IsSuccess)
     {
         MessageBox.Show($"Could not navigate to {e.Uri?.ToString() ?? "NULL"}", $"Error: {e.WebErrorStatus}", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
 private async void Browser_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
 {
     ShowCodeButton.IsEnabled = true;
     RunCodeButton.IsEnabled  = true;
     string toolboxXML   = System.IO.File.ReadAllText(GetFilePath("blockyToolbox.xml"));
     string workspaceXML = System.IO.File.ReadAllText(GetFilePath("blockyWorkspace.xml"));
     //Initialize blocky using toolbox and workspace
     await Browser.InvokeScriptAsync("init", new string[] { toolboxXML, workspaceXML }).ConfigureAwait(true);
 }
示例#4
0
 private void WebView1_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
 {
     System.Diagnostics.Debug.Print("Completed: " + webView1.Source.ToString());
     if (_pendingSourceUpdate != "!")
     {
         this.SourceCode      = _pendingSourceUpdate;
         _pendingSourceUpdate = "!";
     }
 }
示例#5
0
 private void WebView_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
 {
     if (!e.IsSuccess)
     {
         Status = e.WebErrorStatus.ToString();
     }
     else
     {
         Status = "OK";
     }
 }
 private void webBrowser_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
 {
     if (e.Uri.AbsoluteUri.StartsWith(Constants.RedirectUri))
     {
         if (e.Uri.AbsoluteUri.Contains("code="))
         {
             this.AuthCode     = e.Uri.AbsoluteUri.Split(new[] { "code=" }, StringSplitOptions.RemoveEmptyEntries)[1];
             this.DialogResult = true;
         }
         else
         {
             this.DialogResult = false;
         }
     }
 }
示例#7
0
        private void webView1_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
        {
            try
            {
                var link = e.Uri.ToString();
                Log.WriteLog("trade-log.txt", "webView1_NavigationCompleted - " + e.Uri.ToString());
                btnLogin.Focus();
                if (link.Contains("request_token"))
                {
                    string[] strSplit = link.Split('?');
                    if (strSplit.Count() == 2)
                    {
                        string[] strSplit2 = strSplit[1].Split('&');
                        foreach (string s in strSplit2)
                        {
                            if (s.Contains("request_token"))
                            {
                                tradeUser.ApiReturnToken = s.Replace("request_token=", "");
                                break;
                            }
                        }
                    }
                    //tradeUser.ApiReturnToken = link.Replace("http://127.0.0.1:8080/?", "").Replace("&action=login&status=success", "").Replace("request_token=", "");

                    // Collect tokens and user details using the request token
                    User user = kite.GenerateSession(tradeUser.ApiReturnToken, tradeUser.ApiSecret);

                    tradeUser.AccessToken = user.AccessToken;
                    tradeUser.PublicToken = user.PublicToken;
                    tradeUser.kiteUser    = user;

                    // Initialize Kite APIs with access token
                    kite.SetAccessToken(tradeUser.AccessToken);
                    tradeUser.kite = kite;
                    HomeForm home = new HomeForm();
                    home.Show();
                    this.Hide();
                }
            }
            catch (Exception ex)
            {
                Log.WriteLog("trade-log.txt", ex.ToString());
                throw ex;
            }
        }
示例#8
0
        /// <summary>
        /// Navigation Complete
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void WebView_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
        {
            Debug.WriteLine("Navigate Completed to " + e.Uri + " " + e.WebErrorStatus.ToString(), "WebEdge");

            if (e.IsSuccess)
            {
                DocumentCompleted();

                if (!Expired)
                {
                    // Show the browser
                    this.webView.Visibility = System.Windows.Visibility.Visible;
                }
            }
            else
            {
                Trace.WriteLine(new LogMessage("WebEdge", "Cannot navigate to " + e.Uri + ". e = " + e.WebErrorStatus.ToString()), LogType.Error.ToString());

                // This should exipre the media
                Duration = 5;
                base.RestartTimer();
            }
        }
示例#9
0
 private void webView_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
 {
     webView.Height = System.Windows.SystemParameters.PrimaryScreenHeight;
     webView.Focus();
 }
示例#10
0
 private void _webView_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
 {
     // _log?.AppendLine("_webView_NavigationCompleted called" + Environment.NewLine);
 }
示例#11
0
 private void Browser_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
 {
     Loader.Visibility  = Visibility.Hidden;
     Browser.Visibility = Visibility.Visible;
 }
示例#12
0
 private void WvMain_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
 {
     // Final event per page
     setStatus("Navigation Complete");
 }
示例#13
0
 private void Browser_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
 {
     Path.Text = e.Uri.AbsoluteUri;
 }
示例#14
0
 private void WebView_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
 {
     this.lblStatus.Text = e.IsSuccess ? "OK" : "Fail";
     this.lblTitle.Text  = "";
     this.lblUrl.Text    = e.Uri?.ToString();
 }
示例#15
0
 private void xWebView_NavigationCompleted(object sender, Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.WebViewControlNavigationCompletedEventArgs e)
 {
     mTimer.Start();
 }