private Chapter(Chapter chapter)
     : base(chapter)
 {
     Description = chapter.Description;
     ThumbSource = chapter.ThumbSource;
     Title = chapter.Title;
 }
 public ScriptChapter(Chapter item)
 {
     ThumbSource = item.ThumbSource.ToString();
     Title = item.Title;
     Description = item.Description;
     Content = item.Content;
     Id = item.Id;
     Begin = item.Begin.TotalSeconds;
     End = item.End.TotalSeconds;
 }
 private void UpdateChapterSelection(Chapter chapterItem)
 {
     ChapterSelectionElement.IfNotNull(i => i.SelectedItem = chapterItem);
 }
        /// <summary>
        /// Goes to the specified chapter item.
        /// </summary>
        public void GoToChapterItem(Chapter chapterItem)
        {
            if (chapterItem == null) throw new ArgumentNullException("chapterItem");

            if (Playlist != null && CurrentPlaylistItem != null)
            {
                if (!CurrentPlaylistItem.Chapters.Contains(chapterItem))
                {
                    PlaylistItem playlistItem = Playlist.Where(i => i.Chapters.Contains(chapterItem))
                        .FirstOrDefault();

                    if (playlistItem != null)
                    {
                        CurrentPlaylistItem = playlistItem;
                    }
                    else
                    {
                        throw new ArgumentException(
                            SilverlightMediaFrameworkResources.ChapterItemDoesNotBelongToCurrentPlaylistMessage);
                    }
                }

                UpdateChapterSelection(chapterItem);
                SeekToPosition(chapterItem.Begin);
            }
        }