public ShortcutSaveBookmark(string a1) { InitializeComponent(); this.userId = a1; DisplayBookmarkList dbl = new DisplayBookmarkList(); mbt = dbl.getBookmarks(); // registerKeyboard = new RegisterKeyboardInput(this); // registerKeyboard.KeyBoardKeyPressed += keyboard_KeyBoardKeyPressed; foreach (ModelBookmarTag vara in mbt) { DisplaySearchUrl dsu = new DisplaySearchUrl(); dsu.displayUrl = vara.bookmarkedPage.Url; listViewDisplayBookmark.Items.Add(dsu); } defaultBrowser = getDefaultBrowser(); if (!this.IsVisible) { this.Show(); } if (this.WindowState == WindowState.Minimized) { this.WindowState = WindowState.Normal; } //this.WindowStyle = System.Windows.WindowStyle.None; this.Topmost = true; this.Activate(); }
private void RefreshBookmarkList(string[] searchTerms) { listViewDisplayBookmark.Items.Clear(); List <DisplaySearchUrl> displayList = new List <DisplaySearchUrl>(); foreach (ModelBookmarTag m1 in mbt) { if (m1.tagList.Count > 0) { foreach (string term in searchTerms) { bool found = false; DisplaySearchUrl d1 = null; foreach (Tags t1 in m1.tagList) { if (t1.TagName == term && !found && term != "") { found = true; d1 = new DisplaySearchUrl(); d1.displayUrl = m1.bookmarkedPage.Url; d1.hit += 1; } if (found) { d1.hit += 1; } } if (d1 != null) { displayList.Add(d1); } } } } foreach (DisplaySearchUrl dd in displayList) { listViewDisplayBookmark.Items.Add(dd); } }
private void listViewDisplayBookmark_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (listViewDisplayBookmark.SelectedItems.Count == 0) { return; } DisplaySearchUrl d1 = (DisplaySearchUrl)listViewDisplayBookmark.SelectedItem; if (defaultBrowser != "other") { Process.Start(defaultBrowser + ".exe", d1.displayUrl); } else { Clipboard.SetText(d1.displayUrl); MessageBox.Show("Default browser not found, Url was pasted into clipboard"); } //getDefaultBrowser(); //getProceses(); //MessageBox.Show(d1.displayUrl); }