Ejemplo n.º 1
0
 private void SetupForm(PictureViewerForm pictureViewerForm, PictureFile.PictureFile startFile)
 {
     pictureViewerForm.Loop                = Loop;
     pictureViewerForm.TransitionTime      = TransitionTime;
     pictureViewerForm.DelayInSec          = DelayInSec;
     pictureViewerForm.OverlayTextTemplate = OverlayText;
     if (Browse)
     {
         if (!pictureViewerForm.Browsing)
         {
             _slideshowFiles     = pictureViewerForm.Files;
             _slideshowFileIndex = pictureViewerForm.FileIndex;
         }
         pictureViewerForm.Files     = new List <PictureFile.PictureFile>(_browseFiles);
         pictureViewerForm.FileIndex = startFile != null
                                           ? new List <PictureFile.PictureFile>(_browseFiles).IndexOf(startFile)
                                           : 0;
     }
     else
     {
         if (_slideshowFiles != null)
         {
             pictureViewerForm.FileIndex = _slideshowFileIndex;
             pictureViewerForm.Files     = _slideshowFiles;
         }
         else
         {
             List <PictureFile.PictureFile> pictureFiles;
             pictureViewerForm.FileIndex = PrepareFileList(_browseFiles, out pictureFiles);
             pictureViewerForm.Files     = pictureFiles;
         }
     }
     pictureViewerForm.Browsing = Browse;
     pictureViewerForm.ShowPicture();
 }
Ejemplo n.º 2
0
        public void ShowPictures()
        {
            if (GetNumberOfSelectedFiles() == 0)
            {
                return;
            }
            Cursor cursor = _form.Cursor;

            _form.Cursor = Cursors.WaitCursor;
            ThreadExecutionState.DisplayRequired();
            using (PictureViewerForm pictureViewerForm = CreatePictureViewForm())
            {
                UpdateStatusBar();
                _browseFiles = new List <PictureFile.PictureFile>(GetSelectedFiles());
                SetupForm(pictureViewerForm, null);
                pictureViewerForm.ShowDialog();
                _slideshowFiles = null;
            }
            _pictureViewerForm = null;
            ThreadExecutionState.RestoreDefault();
            UpdateStatusBar();
            if (_form.Cursor == Cursors.WaitCursor)
            {
                _form.Cursor = cursor;
            }
        }
Ejemplo n.º 3
0
 private PictureViewerForm CreatePictureViewForm()
 {
     _pictureViewerForm                  = new PictureViewerForm();
     _pictureViewerForm.Icon             = Resources.image_x_generic;
     _pictureViewerForm.PictureShown     = ResumeManager.SetToShown;
     _pictureViewerForm.AllPicturesShown = ResumeManager.SetToNotShown;
     _pictureViewerForm.ToggleBrowsing   = ToggleBrowsing;
     return(_pictureViewerForm);
 }