}\r
}\r
\r
+ public ObservableCollection<ChapterMarker> Chapters\r
+ {\r
+ get\r
+ {\r
+ return this.Task.ChapterNames;\r
+ }\r
+\r
+ set\r
+ {\r
+ this.Task.ChapterNames = value;\r
+ this.NotifyOfPropertyChange(() => this.Chapters);\r
+ }\r
+ }\r
+\r
#endregion\r
\r
#region Properties\r
{\r
using (var csv = new StreamWriter(fileName))\r
{\r
- foreach (ChapterMarker row in this.Task.ChapterNames)\r
+ foreach (ChapterMarker row in this.Chapters)\r
{\r
csv.Write("{0},{1}{2}", row.ChapterNumber, CsvHelper.Escape(row.ChapterName), Environment.NewLine);\r
}\r
}\r
\r
// Now iterate over each chatper we have, and set it's name\r
- foreach (ChapterMarker item in this.Task.ChapterNames)\r
+ foreach (ChapterMarker item in this.Chapters)\r
{\r
// If we don't have a chapter name for this chapter then \r
// fallback to the value that is already set for the chapter\r
public void SetSource(Source source, Title title, Preset preset, EncodeTask task)\r
{\r
this.Task = task;\r
- this.NotifyOfPropertyChange(() => this.Task);\r
\r
if (preset != null)\r
{\r
public void SetPreset(Preset preset, EncodeTask task)\r
{\r
this.Task = task;\r
- this.Task.IncludeChapterMarkers = preset.Task.IncludeChapterMarkers;\r
- this.NotifyOfPropertyChange(() => this.Task);\r
+ this.IncludeChapterMarkers = preset.Task.IncludeChapterMarkers;\r
+ this.NotifyOfPropertyChange(() => this.Chapters);\r
}\r
\r
/// <summary>\r
{\r
this.Task = task;\r
\r
- this.NotifyOfPropertyChange(() => this.Task.IncludeChapterMarkers);\r
- this.NotifyOfPropertyChange(() => this.Task.ChapterNames);\r
+ this.NotifyOfPropertyChange(() => this.IncludeChapterMarkers);\r
+ this.NotifyOfPropertyChange(() => this.Chapters);\r
}\r
\r
/// <summary>\r
{\r
// Cache the chapters in this screen\r
this.SourceChapterList = new ObservableCollection<Chapter>(sourceChapters);\r
- this.Task.ChapterNames.Clear();\r
+ this.Chapters.Clear();\r
\r
// Then Add new Chapter Markers.\r
int counter = 1;\r
{\r
string chapterName = string.IsNullOrEmpty(chapter.ChapterName) ? string.Format("Chapter {0}", counter) : chapter.ChapterName;\r
var marker = new ChapterMarker(chapter.ChapterNumber, chapterName, chapter.Duration);\r
- this.Task.ChapterNames.Add(marker);\r
+ this.Chapters.Add(marker);\r
\r
counter += 1;\r
}\r
validationErrorMessage = null;\r
\r
// If the number of chapters don't match, prompt for confirmation\r
- if (importedChapters.Count != this.Task.ChapterNames.Count)\r
+ if (importedChapters.Count != this.Chapters.Count)\r
{\r
if (this.errorService.ShowMessageBox(\r
- string.Format(Resources.ChaptersViewModel_ValidateImportedChapters_ChapterCountMismatchMsg, this.Task.ChapterNames.Count, importedChapters.Count),\r
+ string.Format(Resources.ChaptersViewModel_ValidateImportedChapters_ChapterCountMismatchMsg, this.Chapters.Count, importedChapters.Count),\r
Resources.ChaptersViewModel_ValidateImportedChapters_ChapterCountMismatchWarning,\r
MessageBoxButton.YesNo,\r
MessageBoxImage.Question) !=\r
// (I chose 15sec based on empirical evidence from testing a few DVDs and comparing to chapter-marker files I downloaded)\r
// => This check will not be performed for the first and last chapter as they're very likely to differ significantly due to language and region\r
// differences (e.g. longer title sequences and different distributor credits)\r
- var diffs = importedChapters.Zip(this.Task.ChapterNames, (import, source) => source.Duration - import.Value.Item2);\r
+ var diffs = importedChapters.Zip(this.Chapters, (import, source) => source.Duration - import.Value.Item2);\r
if (diffs.Count(diff => Math.Abs(diff.TotalSeconds) > 15) > 2)\r
{\r
if (this.errorService.ShowMessageBox(\r