public void ResetDetails() { details = null; this.loadingScreen.Image = ZeroWin.Properties.Resources.NoImage; this.ingameScreen.Image = ZeroWin.Properties.Resources.NoImage; pictureBox1.Image = ZeroWin.Properties.Resources.NoImage; autoLoadComboBox.Items.Clear(); autoLoadComboBox.Items.Add("None"); autoLoadComboBox.SelectedIndex = 0; autoLoadComboBox.Enabled = false; autoLoadFilePath = null; fileList.Clear(); checkedListBox1.Items.Clear(); filesToDownload = 0; fileDownloadCount = 0; button1.Enabled = false; // this.BackgroundImage = null; }
public void ShowDetails(String infoId, String _imageLoc) { toolStripStatusLabel1.Text = "Querying infoseek..."; details = new InfoDetails(); string param = "id=" + infoId; pictureBox1.ImageLocation = _imageLoc; if (checkedListBox1.SelectedItems.Count == 0) { button1.Enabled = false; } else { button1.Enabled = true; } try { lastURL = wos_select + param; HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(lastURL); webRequest.Method = "GET"; // RequestState is a custom class to pass info to the callback RequestState2 rs = new RequestState2(); rs.Request = webRequest; rs.webURL = lastURL; IAsyncResult result = webRequest.BeginGetResponse(new AsyncCallback(SearchCallback), rs); ThreadPool.RegisterWaitForSingleObject(result.AsyncWaitHandle, new WaitOrTimerCallback(InfoseekTimeout), rs, (30 * 1000), // 30 second timeout true ); this.Show(); } catch (WebException we) { MessageBox.Show(we.Message, "Connection Error", MessageBoxButtons.OK); } }