private void fill_RightPanel(AppEntry entry) { lbl_rightpanel_title.Text = entry.Name; webBrowser1.DocumentText = "<html><body style='background-color:black;'></body></html>"; new YoutubeProvider().Run(entry.Name + " review"); if (entry.Screenshot1 == null && entry.Screenshot2 == null & entry.Screenshot3 == null) { var results = ImagesProvider.googleSearch(entry.Name + " screenshot"); entry.Screenshot1 = Tools.GetByteFromUrl(results[0].Link); entry.Screenshot2 = Tools.GetByteFromUrl(results[1].Link); entry.Screenshot3 = Tools.GetByteFromUrl(results[2].Link); DbController.ModifyEntry(entry); } if (entry.Screenshot1 != null) { pic_rightpanel_1.Image = Tools.GetImageFromByte(entry.Screenshot1); } if (entry.Screenshot2 != null) { pic_rightpanel_2.Image = Tools.GetImageFromByte(entry.Screenshot2); } if (entry.Screenshot3 != null) { pic_rightpanel_3.Image = Tools.GetImageFromByte(entry.Screenshot3); } }
public static void RefreshFolders() { List <string> folders = new List <string>(); folders.Add(@"C:\Users\nachog4\Desktop\Gamez\"); folders.Add(@"C:\Users\nachog4\Desktop\VR Gamez\"); foreach (var folder in folders) { string[] filePaths = Directory.GetFiles(folder, "*.lnk", SearchOption.AllDirectories); foreach (var item in filePaths) { ShortcutInfo sInfo = GetShortcutInfo(item); if (sInfo != null && !sInfo.isError && !String.IsNullOrEmpty(sInfo.Path)) { if (DbController.GetEntries(sInfo.Path).Count() == 0) { var results = ImagesProvider.googleSearch(sInfo.Name + " cover"); AppEntry newEntry = new AppEntry(); newEntry.Name = sInfo.Name; newEntry.Path = sInfo.Path; newEntry.Image2 = Tools.GetByteFromUrl(results[0].Link); DbController.AddEntry(newEntry); } } } } }
private void flowLayoutPanel1_DragDrop(object sender, DragEventArgs e) { string[] files3 = (string[])e.Data.GetData(DataFormats.FileDrop); if (quickMode && files3 != null) { foreach (var item in files3) { ShortcutInfo sInfo = new ShortcutInfo(); sInfo = ShortcutsController.GetShortcutInfo(item); if (!sInfo.isError) { if (model.AppEntries.Count(x => x.Path == sInfo.Path) > 0) { continue; } var results = ImagesProvider.googleSearch(sInfo.Name + " cover"); AppEntry newEntry = new AppEntry(); newEntry.Name = sInfo.Name; newEntry.Path = sInfo.Path; newEntry.Image2 = Tools.GetByteFromUrl(results[0].Link); DbController.AddEntry(newEntry); } } ShowAppEntries(); } if (!quickMode && files3 != null) { ShortcutInfo sInfo = new ShortcutInfo(); sInfo = ShortcutsController.GetShortcutInfo(files3[0]); if (!sInfo.isError) { AppEntryDetailsForm entryDetailsForm = new AppEntryDetailsForm(); entryDetailsForm.Show(); entryDetailsForm.InitializeValuesFromShortcut(sInfo); } } }
public void Search(string query) { if (txt_searchtext.Text == "") { txt_searchtext.Text = query; } flowLayoutPanel1.Controls.Clear(); var results = ImagesProvider.googleSearch(query); if (results != null) { foreach (var item in results) { //AddSearchWindowEntry(item.Link); ShowImageResultEntry(item); } } }