Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChapterMarker"/> class.
 /// Copy Constructor
 /// </summary>
 /// <param name="chapter">
 /// The chapter.
 /// </param>
 public ChapterMarker(ChapterMarker chapter)
 {
     this.ChapterName = chapter.ChapterName;
     this.ChapterNumber = chapter.ChapterNumber;
     this.Duration = chapter.Duration;
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChapterMarker"/> class.
 /// Copy Constructor
 /// </summary>
 /// <param name="chapter">
 /// The chapter.
 /// </param>
 public ChapterMarker(ChapterMarker chapter)
 {
     this.ChapterName   = chapter.ChapterName;
     this.ChapterNumber = chapter.ChapterNumber;
     this.Duration      = chapter.Duration;
 }
        /// <summary>
        /// Set the Source Chapters List
        /// </summary>
        /// <param name="sourceChapters">
        /// The source chapters.
        /// </param>
        public void SetSourceChapters(IEnumerable<Chapter> sourceChapters)
        {
            // Cache the chapters in this screen
            this.SourceChapterList = new ObservableCollection<Chapter>(sourceChapters);
            this.Task.ChapterNames.Clear();

            // Then Add new Chapter Markers.
            int counter = 1;

            foreach (Chapter chapter in this.SourceChapterList)
            {
                string chapterName = string.IsNullOrEmpty(chapter.ChapterName) ? string.Format("Chapter {0}", counter) : chapter.ChapterName;
                var marker = new ChapterMarker(chapter.ChapterNumber, chapterName, chapter.Duration);
                this.Task.ChapterNames.Add(marker);

                counter += 1;
            }
        }