/// <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;
        }
        private void readChapterToolStripMenuItem_Click(object sender, EventArgs e)
        {

            var chap = GetSelectedChapterInfo();
            SlideShow slideshow = new SlideShow(chap.Folder);
            slideshow.Show(this);
        }
        /// <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;
        }