Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
 private void MainWorker_TreeNodeAdded(object sender, MediaFolderEventArgs e)
 {
     try
     {
         if (InvokeRequired)
         {
             Invoke(new EventHandler <MediaFolderEventArgs>(MainWorker_TreeNodeAdded), new object[] { sender, e });
         }
         else
         {
             if (e.Folder.Parent != null)
             {
                 if (_folderCollection.ContainsKey(e.Folder.Parent))
                 {
                     TreeNode parentNode = _folderCollection[e.Folder.Parent];
                     TreeNode node       = parentNode.Nodes.Add(e.Folder.Name);
                     node.Tag = e.Folder;
                     _folderCollection.Add(e.Folder, node);
                 }
             }
             else
             {
                 TreeNode node = treeView.Nodes.Add(e.Folder.Name);
                 node.Tag = e.Folder;
                 _folderCollection.Add(e.Folder, node);
             }
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
Esempio n. 4
0
 private void toolStripMenuItemSourceUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         StartScan(false);
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
Esempio n. 5
0
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         EnableControls(false, false);
         _worker.CleanUp();
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
Esempio n. 6
0
 private void treeView_AfterSelect(object sender, TreeViewEventArgs e)
 {
     try
     {
         MediaFolder folder = (MediaFolder)e.Node.Tag;
         RemoveAllThumbnails();
         UpdateProperties(folder);
         CreateThumbnails(folder);
         _worker.LoadThumbnails(folder);
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
Esempio n. 7
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     try
     {
         treeView.Sort();
         EnableControls(true, false);
         _worker.Initialize();
         _worker.LoadSources();
         SetPropertyGridColumnWidth();
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
Esempio n. 8
0
 private void SettingsWorker_VideoThumbnailsMakerPresetUpdated(object sender, StringEventArgs e)
 {
     try
     {
         if (InvokeRequired)
         {
             Invoke(new EventHandler <StringEventArgs>(SettingsWorker_VideoThumbnailsMakerPresetUpdated), new object[] { sender, e });
         }
         else
         {
             textBoxVideoThumbnailsMakerPreset.Text = e.Value;
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
Esempio n. 9
0
 private void SettingsWorker_DatabaseLocationUpdated(object sender, StringEventArgs e)
 {
     try
     {
         if (InvokeRequired)
         {
             Invoke(new EventHandler <StringEventArgs>(SettingsWorker_DatabaseLocationUpdated), new object[] { sender, e });
         }
         else
         {
             textBoxDatabaseLocation.Text = e.Value;
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
Esempio n. 10
0
 private void MainWorker_StatusUpdated(object sender, StringEventArgs e)
 {
     try
     {
         if (InvokeRequired)
         {
             Invoke(new EventHandler <StringEventArgs>(MainWorker_StatusUpdated), new object[] { sender, e });
         }
         else
         {
             toolStripStatusLabelStatus.Text = e.Value;
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
Esempio n. 11
0
 private void MainWorker_ThumbnailAvailable(object sender, MediaFileEventArgs e)
 {
     try
     {
         if (InvokeRequired)
         {
             Invoke(new EventHandler <MediaFileEventArgs>(MainWorker_ThumbnailAvailable), new object[] { sender, e });
         }
         else
         {
             if (e.File.ThumbnailImage != null && _fileCollection.ContainsKey(e.File))
             {
                 ThumbnailContainer thumbnailContainer = _fileCollection[e.File];
                 thumbnailContainer.SetThumbnail(e.File.ThumbnailImage, new Point(10 + (200 - e.File.ThumbnailImage.Size.Width) / 2, 10));
             }
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
Esempio n. 12
0
 private void MainWorker_DatabaseOperationCompleted(object sender, OperationTypeEventArgs e)
 {
     try
     {
         if (InvokeRequired)
         {
             Invoke(new EventHandler <OperationTypeEventArgs>(MainWorker_DatabaseOperationCompleted), new object[] { sender, e });
         }
         else
         {
             if (e.OperationType == MainWorker.OperationType.LoadSources || e.OperationType == MainWorker.OperationType.ScanSource)
             {
                 UpdateTreeNodeFileTypeCounts();
                 treeView.Sort();
             }
             toolStripStatusLabelStatus.Text = "Ready";
             EnableControls(true, true);
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }