private void imgListView_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { ImageMenuStrip.Show(Cursor.Position); } }
private void downloadFromIGDBToolStripMenuItem_Click(object sender, EventArgs e) { if (IGDBList.DropDownItems.Count != 0) { return; } SuspendWindow(true); try { WebClient client = new WebClient(); string HTML = client.DownloadString("https://www.igdb.com/search?type=1&q=" + gGame.Name); string gamelist = Between(ref HTML, "mar-md-bottom text-muted", "hidden-sm hidden-xs"); while (Between(ref gamelist, "id", "release_year") != "" && IGDBList.DropDownItems.Count < gForm.GetIGDBListLength()) { string gamedetails = "id"" + Between(ref gamelist, "id"", "release_year", true); string gamename = System.Web.HttpUtility.HtmlDecode(Between(ref gamedetails, "name":"", """)); string gameurl = Between(ref gamedetails, "url":"", """); string gameid = Between(ref gamedetails, "id":", ",""); Dictionary <string, string> IGDB = new Dictionary <string, string>(); IGDB.Add("name", gamename); IGDB.Add("url", gameurl); IGDB.Add("id", gameid); ToolStripMenuItem item = new ToolStripMenuItem(); item.Text = gamename; item.Tag = IGDB; item.Click += new EventHandler(MenuItemClickHandler); IGDBList.DropDownItems.Add(item); } } catch (Exception) { } if (IGDBList.DropDownItems.Count == 0) { MessageBox.Show("No result from IGDB. Please try another game name."); } else { ImageMenuStrip.Show(); IGDBList.ShowDropDown(); } SuspendWindow(false); }