private void webBrowser_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { //e.Cancel = true; //Console.WriteLine("Radim magiju...."); ////Console.WriteLine(e.Uri.AbsoluteUri); //HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://google.com/"); //HttpWebResponse response = (HttpWebResponse)request.GetResponse(); //webBrowser.NavigateToStream(response.GetResponseStream()); //if (e.Uri.AbsolutePath != "blank") //{ //string url = "http://www." + Manager.selectedProfile.Domain.Replace("global.", ""); //Uri currentUri = new Uri(url); //currentUri = new Uri(currentUri, e.Uri.AbsolutePath); //HttpWebRequest myRequest = (HttpWebRequest)HttpWebRequest.Create(currentUri); //HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse(); //Console.WriteLine(currentUri); //webBrowser.NavigateToStream(myResponse.GetResponseStream()); //e.Cancel = true; //} }
private void webBrowser_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.Uri.Fragment.StartsWith("#url=") && e.Uri.Fragment.Contains("&error=1")) { this.HandleWrongUrl(e.Uri.Fragment); return; } if (!e.Uri.AbsoluteUri.StartsWith("http://localhost/#")) { return; } var parameters = new ParameterCollection(e.Uri.Fragment.Substring(1)); this.AccessToken = parameters["access_token"]; var serializer = new JsonNetSerializer(); var urlEncoder = new JwtBase64UrlEncoder(); var decoder = new JwtDecoder(serializer, urlEncoder); var payload = decoder.DecodeToObject(this.AccessToken); this.UserName = payload["username"].ToString(); this.Server = payload["ws"].ToString(); this.DialogResult = true; this.Close(); }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { PeerFinder.ConnectionRequested -= PeerFinder_ConnectionRequested; base.OnNavigatingFrom(e); }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.NavigationMode == System.Windows.Navigation.NavigationMode.Back) { e.Cancel = true; } }
void OnNavigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (IsSystemDialogNavigation(e.Uri)) { currentPageUri = navigationSvc.CurrentSource; } }
private void NavigationService_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (!(e.Content is TemplateSettings)) { layoutManager.UnregisterTemplate(); } }
private void stripeBrowser_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.Uri.AbsoluteUri.ToLower().Contains("tunnels://stripesuccess")) { Dispatcher.BeginInvoke((Action)(() => loginTabControl.SelectedIndex = 5)); } }
private void WBBrowser_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (!e.Uri.ToString().Contains("https://www.youtube.com/")) { txtUrl.Text = e.Uri.OriginalString; } }
private void Browser_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (!e.Uri.AbsoluteUri.ToString().StartsWith(RedirectUri.ToString(), StringComparison.OrdinalIgnoreCase)) { // we need to ignore all navigation that isn't to the redirect uri. return; } try { OAuth2Response result = DropboxOAuth2Helper.ParseTokenFragment(e.Uri); if (result.State != DBoauth2State) { return; } this.AccessToken = result.AccessToken; this.Uid = result.Uid; this.Result = true; } catch (ArgumentException ex) { MessageBox.Show(ex.Message); } finally { e.Cancel = true; this.Close(); } }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { base.OnNavigatingFrom(e); // Relays the event to the view model. ViewModel.OnPageNavigatingFrom(e, NavigationContext); }
/// <summary> /// Make it possible that the Frame can use the default proxy & credentials, so we can make it go to any link /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CurrentSettingsPage_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.Uri != null && coreConfiguration.UseProxy) { e.WebRequest.Proxy = GreenshotPlugin.Core.NetworkHelper.CreateProxy(e.Uri); } }
private void webBrowser_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.Uri.Query.Contains("code=")) { string code = e.Uri.Query.Substring(1).Split('&')[0].Split('=')[1]; var client = new RestClient(_redeemUrl); var request = new RestRequest(Method.POST); string base64String = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{Settings.Default.ClientID}:{Settings.Default.ClientSecret}")); request.AddHeader("Authorization", $"Basic {base64String}"); // request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); string requestBody = $"client_id={Settings.Default.ClientID}&grant_type=authorization_code&redirect_uri={_redirectUri}&code={code}"; request.AddParameter("application/x-www-form-urlencoded", requestBody, ParameterType.RequestBody); var response = (RestResponse)client.Execute(request); var content = response.Content; // Parse content and get auth code Settings.Default.AccessToken = JObject.Parse(content)["access_token"].Value <string>(); Settings.Default.Save(); Close(); } }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { base.OnNavigatingFrom(e); string uri = e.Uri.ToString(); PhoneApplicationService.Current.State[HikeConstants.COUNTRY_SELECTED] = txtEnterCountry.Text; if (!uri.Contains("View")) { if (!string.IsNullOrWhiteSpace(txtEnterPhone.Text)) { this.State["txtEnterPhone"] = txtEnterPhone.Text; } else { this.State.Remove("txtEnterPhone"); } if (msisdnErrorTxt.Visibility == Visibility.Visible) { this.State["msisdnErrorTxt.Text"] = msisdnErrorTxt.Text; this.State["msisdnErrorTxt.Visibility"] = msisdnErrorTxt.Visibility; } else { this.State.Remove("msisdnErrorTxt.Text"); this.State.Remove("msisdnErrorTxt.Visibility"); } } else { App.IS_TOMBSTONED = false; } }
private void WbBrowserNavigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.Uri != null && e.Uri.AbsoluteUri.ToUpper().StartsWith("http://Strohi.tv/".ToUpper())) { this.Close(); } }
//navigate to a url but get some user input first public void NavigateGeminiWithInput(System.Windows.Navigation.NavigatingCancelEventArgs e, string message) { //position input box approx in middle of main window var windowCentre = WindowGeometry.WindowCentre((Window)mMainWindow); var inputPrompt = "Input request from Gemini server\n\n" + " " + e.Uri.Host + e.Uri.LocalPath.ToString() + "\n\n" + message; string input = Interaction.InputBox(inputPrompt, "Server input request", "", windowCentre.Item1, windowCentre.Item2); if (input != "") { //encode the query var b = new UriBuilder(); b.Scheme = e.Uri.Scheme; b.Host = e.Uri.Host; if (e.Uri.Port != -1) { b.Port = e.Uri.Port; } b.Path = e.Uri.LocalPath; //!%22%C2%A3$%25%5E&*()_+1234567890-=%7B%7D:@~%3C%3E?[];'#,./ b.Query = System.Uri.EscapeDataString(input); //escape the query result //ToastNotify(b.ToString()); mWebBrowser.Navigate(b.ToString()); } else { //dont do anything further with navigating the browser e.Cancel = true; } }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { _cam.CancelFocus(); _cam.Dispose(); base.OnNavigatingFrom(e); }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { //enable lock screen PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Enabled; //try //{ // CameraButtons.ShutterKeyHalfPressed -= CameraButtons_ShutterKeyHalfPressed; // CameraButtons.ShutterKeyPressed -= CameraButtons_ShutterKeyPressed; // CameraButtons.ShutterKeyReleased -= CameraButtons_ShutterKeyReleased; //} //catch (Exception) { } if (initialized && this.m_d3dBackground.IsROMLoaded()) { //this.m_d3dBackground.PauseEmulation(); } if (this.m_d3dBackground.LoadadROMFile == null) { base.OnNavigatingFrom(e); } else { ROMDatabase db = ROMDatabase.Current; var entry = db.GetROM(this.m_d3dBackground.LoadadROMFile.Name); if (entry != null) { entry.LastPlayed = DateTime.Now; db.CommitChanges(); } base.OnNavigatingFrom(e); } }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.Uri.IsAbsoluteUri == true && e.Uri.AbsoluteUri == "/LoginPage.xaml") { Helper.GetHelper().ExitApp(); } }
// Dispose of camera when exiting. protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { if (this.camera != null) { this.camera.Dispose(); } }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { base.OnNavigatingFrom(e); WindowsPhoneRecipes.Logger.Instance.AddLine(); this.ApplicationBar.IsVisible = false; }
void RootFrame_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (RootFrame.Content is LoginView && !(e.Content is SettingsView)) { _clearStack = true; } }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { base.OnNavigatingFrom(e); string uri = e.Uri.ToString(); if (!uri.Contains("View")) { if (!string.IsNullOrWhiteSpace(txtBxEnterName.Text)) { this.State["txtBxEnterName"] = txtBxEnterName.Text; } else { this.State.Remove("txtBxEnterName"); } if (msgTxtBlk.Opacity == 1) { this.State["nameErrorTxt.Text"] = nameErrorTxt.Text; this.State["nameErrorTxt.Visibility"] = nameErrorTxt.Visibility; } else { this.State.Remove("nameErrorTxt.Text"); this.State.Remove("nameErrorTxt.Visibility"); } } else { App.IS_TOMBSTONED = false; } }
private static void OnFrameNavigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.NavigationMode == System.Windows.Navigation.NavigationMode.Back || e.NavigationMode == System.Windows.Navigation.NavigationMode.Forward) { e.Cancel = true; } }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { try { CameraButtons.ShutterKeyHalfPressed -= CameraButtons_ShutterKeyHalfPressed; CameraButtons.ShutterKeyPressed -= CameraButtons_ShutterKeyPressed; CameraButtons.ShutterKeyReleased -= CameraButtons_ShutterKeyReleased; } catch (Exception) { } if (initialized && this.m_d3dBackground.IsROMLoaded()) { //this.m_d3dBackground.PauseEmulation(); } if (this.m_d3dBackground.LoadadROMFile == null) { base.OnNavigatingFrom(e); } else { ROMDatabase db = ROMDatabase.Current; var entry = db.GetROM(this.m_d3dBackground.LoadadROMFile.Name); if (entry != null) { entry.LastPlayed = DateTime.Now; db.CommitChanges(); } base.OnNavigatingFrom(e); } }
private void OnNavigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.Uri.Host == "google.bg") { OnLoggedIn(); } }
private void Control_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { CookieWebView.OnNavigating(new CookieNavigationEventArgs() { Url = e.Uri.ToString() }); }
/* * ============================================ * Event * ============================================ */ private void Browser_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { // We need to ignore all navigation that isn't to the redirect uri. if (!e.Uri.ToString().StartsWith(REDIRECT_URI, StringComparison.OrdinalIgnoreCase)) { return; } try { DropboxApi.OAuth2Response result = DropboxApi.DropboxOAuth2Helper.ParseTokenFragment(e.Uri); // The state in the response doesn't match the state in the request. if (result.State != this.oauth2State) { return; } this.accessToken = result.AccessToken; this.Uid = result.Uid; this.result = true; } catch (ArgumentException) { // There was an error in the URI passed to ParseTokenFragment } finally { e.Cancel = true; this.Close(); } }
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { Messenger.Default.Unregister <MetaDataViewModel>(this, MessengerToken.GetLink, GetLinkPage); _viewModel.UnregisterMessengers.Execute(null); base.OnNavigatingFrom(e); }
private void m_frame_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.NavigationMode == System.Windows.Navigation.NavigationMode.Back || e.NavigationMode == System.Windows.Navigation.NavigationMode.Forward) { CurrentViewModel?.OnNavigatingAway(e); } }
private void Browser_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e) { if (e.Uri != null) { if (HelpFiles.ContainsKey(e.Uri.AbsolutePath)) { e.Cancel = true; Tree.ItemContainerGenerator.ContainerFromItem(Tree.ItemContainerGenerator.Items.Cast <KeyValuePair <string, string> >().First(x => x.Key == e.Uri.AbsolutePath)).SetValue(TreeViewItem.IsSelectedProperty, true); } else if (e.Uri.AbsolutePath.StartsWith("Licenses/")) { e.Cancel = true; var file = Path.Combine(path, e.Uri.AbsolutePath); if (File.Exists(file)) { Process.Start(file); } } else { e.Cancel = true; Process.Start(e.Uri.ToString()); } } }