Example #1
0
 private string GetTitle()
 {
     if (m_IdChapter == null)
     {
         return(m_oBook.Name);
     }
     else
     {
         CChapter oChapter = (CChapter)m_oBook.Chapter[m_IdChapter];
         return(m_oBook.Name + " - " + oChapter.ChapterName);
     }
 }
Example #2
0
 private void GetPage()
 {
     if (m_IdChapter == null)
     {
         m_oPage = m_oBook.GetPage(m_iActualPage);
     }
     else
     {
         CChapter oChapter = (CChapter)m_oBook.Chapter[m_IdChapter];
         m_oPage = oChapter.GetPage(m_iActualPage);
     }
 }
Example #3
0
 private int GetPagesCount()
 {
     if (m_IdChapter == null)
     {
         return(m_oBook.Pages.Count);
     }
     else
     {
         CChapter oChapter = (CChapter)m_oBook.Chapter[m_IdChapter];
         return(oChapter.Pages.Count);
     }
 }
Example #4
0
        private void LoadPicturePage()
        {
            string sImage = "";

            splitContainer5.SplitterDistance = this.Width - 59;
            splitContainer1.SplitterDistance = this.Width - splitContainer5.Width - 1;


            if (pictureBox1.BackgroundImage != null)
            {
                pictureBox1.BackgroundImage.Dispose();
                pictureBox1.BackgroundImage = null;
                GC.Collect();
            }

            try
            {
                if (m_IdChapter == null)
                {
                    m_oPage = m_oBook.GetPage(m_iActualPage);
                }
                else
                {
                    CChapter oChapter = (CChapter)m_oBook.Chapter[m_IdChapter];
                    m_oPage = oChapter.GetPage(m_iActualPage);
                }
                sImage = CGenDef.BooksDir + "\\" + m_oBook.NameId + "\\" + m_oPage.Background;
                pictureBox1.BackgroundImage = new Bitmap(sImage);
            }
            catch
            {
                pictureBox1.BackgroundImage = new Bitmap(CGenDef.BooksDir + m_oBook.NameId + "\\cover.png");
            }


            if (pictureBox1.BackgroundImage.Width < this.Width - 119)
            {
                splitContainer1.SplitterDistance = this.Width - pictureBox1.BackgroundImage.Width - 59;
                splitContainer5.SplitterDistance = pictureBox1.BackgroundImage.Width;
            }
        }