private void readChapterToolStripMenuItem_Click(object sender, EventArgs e)
        {

            var chap = GetSelectedChapterInfo();
            SlideShow slideshow = new SlideShow(chap.Folder);
            slideshow.Show(this);
        }
        /// <summary>
        /// Cleans up all the field members that implement the IDisposable interface.
        /// (This should only be called from the forms dispose method)
        /// </summary>
        /// <param name="bDispose">True to dispose of managed resources.</param>
        /// <returns></returns>
        private void CleanUpResources(bool bDispose)
        {
            if (bDispose)
            {
                // Clean up and release the print document object.
                if (m_oPrintDocument != null)
                {
                    m_oPrintDocument.Dispose();
                    m_oPrintDocument = null;
                }

                // Clean up the ImageEditManagement object.
                if ((m_oUndoRedo != null) && (!m_oUndoRedo.IsDisposed))
                {
                    m_oUndoRedo.Dispose();
                    m_oUndoRedo = null;
                }

                // Clean up the image browser object.
                if ((m_oImageBrowser != null) && (!m_oImageBrowser.IsDisposed))
                {
                    m_oImageBrowser.Dispose();
                    m_oImageBrowser = null;
                }

                // Clean up the explorer docking window object.
                if ((m_oExplorerDockWindow != null) && (!m_oExplorerDockWindow.IsDisposed))
                {
                    m_oExplorerDockWindow.Dispose();
                    m_oExplorerDockWindow = null;
                }

                // Clean up the image list docking window object.
                if ((m_oImageListDockWindow != null) && (!m_oImageListDockWindow.IsDisposed))
                {
                    m_oImageListDockWindow.Dispose();
                    m_oImageListDockWindow = null;
                }

                // Clean up the task docking window object.
                if ((m_oTaskDockWindow != null) && (!m_oTaskDockWindow.IsDisposed))
                {
                    m_oTaskDockWindow.Dispose();
                    m_oTaskDockWindow = null;
                }

                // Clean up the screen shot form.
                if ((m_oScreenShotForm != null) && (!m_oScreenShotForm.IsDisposed))
                {
                    m_oScreenShotForm.Dispose();
                    m_oScreenShotForm = null;
                }

                // Clean up the new window form.
                if ((m_oNewWindowForm != null) && (!m_oNewWindowForm.IsDisposed))
                {
                    m_oNewWindowForm.Dispose();
                    m_oNewWindowForm = null;
                }

                // Clean up the new window list.
                if ((m_oNewWindows != null) && (m_oNewWindows.Count > 0))
                {
                    m_oNewWindows.Clear();
                    m_oNewWindows = null;
                }

                // Clean up the slide show.
                if ((m_oSlideShowForm != null) && (!m_oSlideShowForm.IsDisposed))
                {
                    m_oSlideShowForm.Close();
                    m_oSlideShowForm = null;
                }

                // Clean up the red eye panel.
                if ((m_oRedEyePanel != null) && (!m_oRedEyePanel.IsDisposed))
                {
                    m_oRedEyePanel.Dispose();
                    m_oRedEyePanel = null;
                }

                // Clean up the resize panel.
                if ((m_oResizePanel != null) && (!m_oResizePanel.IsDisposed))
                {
                    m_oResizePanel.Dispose();
                    m_oResizePanel = null;
                }

                // Clean up the properties panel.
                if ((m_oPropertiesPanel != null) && (!m_oPropertiesPanel.IsDisposed))
                {
                    m_oPropertiesPanel.Dispose();
                    m_oPropertiesPanel = null;
                }
            }
        }
        /// <summary>
        /// iView.NET subroutine. Opens an OpenFileDialog control, allowing the user to select
        /// a slide show file to open.
        /// </summary>
        /// <returns></returns>
        private SResult SubOpenSlideShow()
        {
            SResult nResult = SResult.Void;

            using (OpenFileDialog oDlg = new OpenFileDialog())
            {
                oDlg.AutoUpgradeEnabled = true;
                oDlg.InitialDirectory = ApplicationData.SlideShowFolder;
                oDlg.Filter = "Slide Show File (*.ssf)|*.ssf";
                oDlg.Title = "Open Slide Show";

                if (oDlg.ShowDialog(this) == DialogResult.OK)
                {
                    if ((m_oSlideShowForm != null) && (!m_oSlideShowForm.IsDisposed))
                        m_oSlideShowForm.Close();

                    // Open the slide show form.
                    m_oSlideShowForm = new SlideShow(oDlg.FileName);
                    m_oSlideShowForm.Show(this);

                    nResult = SResult.Completed;
                }
            }

            return nResult;
        }
        /// <summary>
        /// iView.NET subroutine. Starts the slide show with the currently selected files in the explorer listview.
        /// If no files have been selected, all files in the listview will be loaded.
        /// </summary>
        /// <returns></returns>
        public SResult SubStartSlideShow(bool all)
        {
            if (!m_oImageBrowser.IsLoaded)
                return SResult.Void;

            SResult nResult = SResult.Void;
            int n = 0, nSelectedItems = all ? 0 : elvw_Images.SelectedItems.Count;
            string[] sPaths = null;

           
            if (nSelectedItems == 0 )
            {
                sPaths = new string[elvw_Images.Items.Count];

                foreach (ListViewItem oItem in elvw_Images.Items)
                    sPaths[n++] = oItem.Name;
            }
            else
            {
                sPaths = new string[elvw_Images.SelectedItems.Count];

                foreach (ListViewItem oItem in elvw_Images.SelectedItems)
                    sPaths[n++] = oItem.Name;
            }
        
            // Show the SlideShow if files have been loaded.
            if (n != 0)
            {
                // Open the slide show form.
                m_oSlideShowForm = new SlideShow(sPaths);
                m_oSlideShowForm.Show(this);

                nResult = SResult.Completed;
            }
            else
            {
                MessageBox.Show("Unable to start the slide show as there are no files loaded.", "Error Starting Slide Show",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);

                nResult = SResult.Void;
            }

            return nResult;
        }