コード例 #1
0
ファイル: ChapterMarker.cs プロジェクト: lvaleriu/HandBrake
 /// <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;
 }
コード例 #2
0
ファイル: ChapterMarker.cs プロジェクト: mason105/hb-saintdev
 /// <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;
 }
コード例 #3
0
        /// <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;
            }
        }