private void SettingsWorker_SourceListUpdated(object sender, SourceListEventArgs e) { try { if (InvokeRequired) { Invoke(new EventHandler <SourceListEventArgs>(SettingsWorker_SourceListUpdated), new object[] { sender, e }); } else { listViewSources.BeginUpdate(); listViewSources.Items.Clear(); foreach (GallerySource source in e.Sources) { ListViewItem item = listViewSources.Items.Add(source.Path); item.SubItems.Add(source.ImageCount.ToString()); item.SubItems.Add(source.VideoCount.ToString()); item.SubItems.Add(source.ScanDateStr); item.Tag = source; } listViewSources.EndUpdate(); } } catch (Exception ex) { FormUtilities.ShowError(this, ex); } }
private void MainWorker_SourceListUpdated(object sender, SourceListEventArgs e) { try { if (InvokeRequired) { Invoke(new EventHandler <SourceListEventArgs>(MainWorker_SourceListUpdated), new object[] { sender, e }); } else { toolStripComboBoxSource.BeginUpdate(); toolStripComboBoxSource.Items.Clear(); foreach (GallerySource source in e.Sources) { toolStripComboBoxSource.Items.Add(new ComboBoxItem(source.Path, source)); } toolStripComboBoxSource.EndUpdate(); EnableControls(true, true); } } catch (Exception ex) { FormUtilities.ShowError(this, ex); } }