Esempio n. 1
0
 private void imgListView_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         ImageMenuStrip.Show(Cursor.Position);
     }
 }
Esempio n. 2
0
        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&quot" + Between(ref gamelist, "id&quot", "release_year", true);
                    string gamename    = System.Web.HttpUtility.HtmlDecode(Between(ref gamedetails, "name&quot;:&quot;", "&quot;"));
                    string gameurl     = Between(ref gamedetails, "url&quot;:&quot;", "&quot;");
                    string gameid      = Between(ref gamedetails, "id&quot;:", ",&quot;");

                    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);
        }