private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e) { if (e.UserState is InternetImage) { var img = e.UserState as InternetImage; var preview = new ImagePreview(flowLayoutPanel1, Form1_MouseMove, Form1_MouseClick, Form1_DoubleClick, img); flowLayoutPanel1.Height = preview.Height + preview.Margin.Vertical; //flowLayoutPanel1.DoubleBuffered = true; } if (e.UserState is CTDBResponseMeta) { var metadata = e.UserState as CTDBResponseMeta; var freedbenc = FreedbToEncoding(metadata); AddMeta(metadata); if (freedbenc != null) { AddMeta(freedbenc); } } }
public void Form1_MouseClick(object sender, MouseEventArgs e) { ImagePreview ssp = null; if (sender is ImagePreview) { ssp = sender as ImagePreview; } //else if (sender is LargeImage) //{ // if (m_current_control is ImagePreview) // { // ssp = m_current_control as ImagePreview; // } //} else if (sender is Control) { Control cp = (sender as Control).Parent; if (cp != null) { if (cp is ImagePreview) { ssp = cp as ImagePreview; } } } if (ssp != null) { if (m_currently_selected != null) { m_currently_selected.Selected = false; } ssp.Selected = true; m_currently_selected = ssp; //AcceptImage.Enabled = true; } }
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { this.progressBar1.Visible = false; this.button1.Visible = true; this.button2.Visible = true; if (listView1.Items.Count == 0 && flowLayoutPanel1.Controls.Count == 0) { this.DialogResult = DialogResult.Cancel; return; } if (listView1.Items.Count > 0) { listView1.Items[0].Selected = true; } if (flowLayoutPanel1.Controls.Count > 0 && m_currently_selected == null) { m_currently_selected = flowLayoutPanel1.Controls[0] as ImagePreview; m_currently_selected.Selected = true; } if ((!this.cdinfo || listView1.Items.Count == 1) && (!this.cover || flowLayoutPanel1.Controls.Count == 1)) { this.DialogResult = DialogResult.OK; } }
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e) { if (e.UserState is InternetImage) { var img = e.UserState as InternetImage; var preview = new ImagePreview(flowLayoutPanel1, Form1_MouseMove, Form1_MouseClick, Form1_DoubleClick, img); flowLayoutPanel1.Height = preview.Height + preview.Margin.Vertical; //flowLayoutPanel1.DoubleBuffered = true; } if (e.UserState is CTDBResponseMeta) { var metadata = e.UserState as CTDBResponseMeta; var freedbenc = FreedbToEncoding(metadata); AddMeta(metadata); if (freedbenc != null) AddMeta(freedbenc); } }
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { this.progressBar1.Visible = false; this.button1.Visible = true; this.button2.Visible = true; if (listView1.Items.Count == 0 && flowLayoutPanel1.Controls.Count == 0) { this.DialogResult = DialogResult.Cancel; return; } if (listView1.Items.Count > 0) listView1.Items[0].Selected = true; if (flowLayoutPanel1.Controls.Count > 0 && m_currently_selected == null) { m_currently_selected = flowLayoutPanel1.Controls[0] as ImagePreview; m_currently_selected.Selected = true; } if ((!this.cdinfo || listView1.Items.Count == 1) && (!this.cover || flowLayoutPanel1.Controls.Count == 1)) { this.DialogResult = DialogResult.OK; } }
public void Form1_MouseClick(object sender, MouseEventArgs e) { ImagePreview ssp = null; if (sender is ImagePreview) { ssp = sender as ImagePreview; } //else if (sender is LargeImage) //{ // if (m_current_control is ImagePreview) // { // ssp = m_current_control as ImagePreview; // } //} else if (sender is Control) { Control cp = (sender as Control).Parent; if (cp != null) { if (cp is ImagePreview) { ssp = cp as ImagePreview; } } } if (ssp != null) { if (m_currently_selected != null) { m_currently_selected.Selected = false; } ssp.Selected = true; m_currently_selected = ssp; //AcceptImage.Enabled = true; } }