Exemplo n.º 1
0
 private static Chapter CreateDefaultChapter(Chapter chapter)
 {
     return new Chapter(chapter.Number, chapter.StartTime.TotalSeconds)
            {
                Title = null,
                Language = chapter.Language
            };
 }
Exemplo n.º 2
0
 private ListViewItem ToListItem(Chapter chapter)
 {
     var item = new ListViewItem(chapter.Title) { Tag = chapter, Checked = chapter.Keep };
     var subitems = new[]
         {
             new ListViewItem.ListViewSubItem(item, chapter.StartTime.ToStringMedium()) { Tag = chapter.StartTime },
             new ListViewItem.ListViewSubItem(item, chapter.Number.ToString("D")) { Tag = chapter.Number }
         };
     item.SubItems.AddRange(subitems);
     return item;
 }
Exemplo n.º 3
0
 private static string GetChapterDupKey(Chapter chapter)
 {
     return string.Format("{0}/{1}", chapter.Number, chapter.StartTime);
 }
Exemplo n.º 4
0
 private static Chapter Transform(JsonChapter jsonChapter, int i)
 {
     var title = (jsonChapter.name ?? "").Trim();
     var isValidChapterName = IsValidChapterName(title);
     var chapter = new Chapter(i + 1, jsonChapter.time.TotalSeconds) { Title = title, Keep = isValidChapterName };
     return chapter;
 }