private void timer2_Tick(object sender, EventArgs e) { // Update view if (lstTitles.SelectedItems.Count == 0) { return; } Item itm = (lstTitles.SelectedItems[0].Tag as Item); if (itm != previousSelectedItem) { previousSelectedItem = itm; tokenSource.Cancel(); tokenSource = new CancellationTokenSource(); Task.Run(() => { Helpers.Renascene r = new Helpers.Renascene(itm); if (r.imgUrl != null) { Invoke(new Action(() => { ptbCover.LoadAsync(r.imgUrl); label5.Text = r.ToString(); lnkOpenRenaScene.Tag = r.url; lnkOpenRenaScene.Visible = true; })); } else { Invoke(new Action(() => { ptbCover.Image = null; label5.Text = ""; lnkOpenRenaScene.Visible = false; })); } }, tokenSource.Token); } }
private void timer2_Tick(object sender, EventArgs e) { //update view if (listView1.SelectedItems.Count == 0) { return; } Item itm = (listView1.SelectedItems[0].Tag as Item); if (itm != previousSelectedItem) { previousSelectedItem = itm; tokenSource.Cancel(); tokenSource = new CancellationTokenSource(); Task.Run(() => { Helpers.Renascene r = new Helpers.Renascene(itm); if (r.imgUrl != null) { Invoke(new Action(() => { pictureBox1.LoadAsync(r.imgUrl); label5.Text = r.ToString(); })); } else { Invoke(new Action(() => { pictureBox1.Image = null; label5.Text = ""; })); } }, tokenSource.Token); } }
private void listView1_SelectedIndexChanged(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 0) { return; } Item itm = (listView1.SelectedItems[0].Tag as Item); lbl_query_size.Text = "0 MB"; Helpers.Renascene r = new Helpers.Renascene(itm.TitleId); if (r.imgUrl != null) { pictureBox1.LoadAsync(r.imgUrl); label5.Text = r.ToString(); } else { pictureBox1.Image = null; label5.Text = ""; } }