Ejemplo n.º 1
0
        private void PopulateChapters()
        {
            cmboChapter.Items.Clear();
            foreach (Chapter chapter in ReaderHelper.SortChapters(title.GetChapters()))
            {
                cmboChapter.Items.Add(chapter.GetNum());
                if (chapter.GetNum().Equals(title.GetCurrentChapter()))
                {
                    currentChapter = chapter;
                }
            }

            if (currentChapter == null)
            {
                currentChapter = ReaderHelper.SortChapters(title.GetChapters())[0];
            }

            try
            {
                cmboChapter.SelectedIndex = cmboChapter.Items.IndexOf(currentChapter.GetNum());
            } catch (Exception)
            {
                MessageBox.Show("An error occured while selecting the current chapter");
                cmboChapter.SelectedIndex = 0;
            }
        }
Ejemplo n.º 2
0
 private void CmboChapter_SelectedIndexChanged(object sender, EventArgs e)
 {
     currentChapter = ReaderHelper.SortChapters(title.GetChapters())[cmboChapter.SelectedIndex];
     PopulatePages();
 }