示例#1
0
 private void ToolStripMenuItemGalleryOpen_Click(object sender, EventArgs e)
 {
     try
     {
         OpenFileDialog fileDialog = new OpenFileDialog()
         {
             CheckPathExists = true,
             CheckFileExists = false,
             SupportMultiDottedExtensions = true,
             AddExtension = true,
             DefaultExt   = "mgdb",
             Filter       = "Media Gallery Database (*.mgdb)|*.mgdb",
             Title        = "Media Gallery Database"
         };
         if (fileDialog.ShowDialog(this) == DialogResult.OK)
         {
             GalleryContainer galleryContainer = CreateContainer(new Gallery(fileDialog.FileName));
             galleryContainer.Worker.LoadGallery();
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
示例#2
0
 private void ToolStripMenuItemGalleryClose_Click(object sender, EventArgs e)
 {
     try
     {
         TabPage selectedTab = tabControlGalleries.SelectedTab;
         if (selectedTab != null)
         {
             DisposeTab(selectedTab);
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
示例#3
0
 private void ToolStripMenuItemGalleryNew_Click(object sender, EventArgs e)
 {
     try
     {
         NewGalleryForm newGalleryForm = new NewGalleryForm();
         if (newGalleryForm.ShowDialog(this) == DialogResult.OK)
         {
             CreateTab(CreateContainer(newGalleryForm.Gallery));
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
示例#4
0
 private void GalleryContainer_TreeSelectionChanged(object sender, BooleanEventArgs e)
 {
     try
     {
         if (InvokeRequired)
         {
             Invoke(new EventHandler <BooleanEventArgs>(GalleryContainer_TreeSelectionChanged), new object[] { sender, e });
         }
         else
         {
             toolStripMenuItemSource.Enabled = e.Value;
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
示例#5
0
 private void GalleryContainer_StatusUpdated(object sender, StringEventArgs e)
 {
     try
     {
         if (InvokeRequired)
         {
             Invoke(new EventHandler <StringEventArgs>(GalleryContainer_StatusUpdated), new object[] { sender, e });
         }
         else
         {
             toolStripStatusLabelStatus.Text = e.Value;
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
示例#6
0
 private void GalleryContainer_GalleryOpened(object sender, EventArgs e)
 {
     try
     {
         if (InvokeRequired)
         {
             Invoke(new EventHandler <EventArgs>(GalleryContainer_GalleryOpened), new object[] { sender, e });
         }
         else
         {
             CreateTab((GalleryContainer)sender);
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
示例#7
0
 private void ToolStripMenuItemGalleryAddSource_Click(object sender, EventArgs e)
 {
     try
     {
         TabPage selectedTab = tabControlGalleries.SelectedTab;
         if (selectedTab != null)
         {
             GalleryContainer galleryContainer = (GalleryContainer)selectedTab.Tag;
             if (galleryContainer != null)
             {
                 galleryContainer.Worker.AddSource();
             }
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }