public ChapterMarkersDialogViewModel(List <Chapter> chapters, List <string> currentNames, bool useDefaultNames)
        {
            this.chapters = chapters;

            this.chapterNames = new ObservableCollection <ChapterNameViewModel>();

            TimeSpan startTime = TimeSpan.Zero;

            for (int i = 0; i < this.chapters.Count; i++)
            {
                Chapter chapter = this.chapters[i];

                var viewModel = new ChapterNameViewModel {
                    Number = i + 1, StartTime = startTime.ToString(Utilities.TimeFormat)
                };
                if (currentNames != null && i < currentNames.Count)
                {
                    viewModel.Title = currentNames[i];
                }
                else
                {
                    viewModel.Title = "Chapter " + (i + 1);
                }

                this.chapterNames.Add(viewModel);

                startTime += chapter.Duration;
            }

            this.useDefaultNames = useDefaultNames;
        }
		public ChapterMarkersDialogViewModel(List<Chapter> chapters, List<string> currentNames, bool useDefaultNames)
		{
			this.chapters = chapters;

			this.chapterNames = new ObservableCollection<ChapterNameViewModel>();

			TimeSpan startTime = TimeSpan.Zero;
			for (int i = 0; i < this.chapters.Count; i++)
			{
				Chapter chapter = this.chapters[i];

				var viewModel = new ChapterNameViewModel { Number = i + 1, StartTime = startTime.ToString(Utilities.TimeFormat) };
				if (currentNames != null && i < currentNames.Count)
				{
					viewModel.Title = currentNames[i];
				}
				else
				{
					viewModel.Title = "Chapter " + (i + 1);
				}

				this.chapterNames.Add(viewModel);

				startTime += chapter.Duration;
			}

			this.useDefaultNames = useDefaultNames;
		}
        public ChapterMarkersDialogViewModel(List <SourceChapter> chapters, List <string> currentNames, bool useDefaultNames)
        {
            this.chapters = chapters;

            this.chapterNames = new ObservableCollection <ChapterNameViewModel>();

            TimeSpan startTime = TimeSpan.Zero;

            for (int i = 0; i < this.chapters.Count; i++)
            {
                SourceChapter chapter = this.chapters[i];

                var viewModel = new ChapterNameViewModel {
                    Number = i + 1, StartTime = startTime.ToString(Utilities.TimeFormat)
                };
                if (currentNames != null && i < currentNames.Count)
                {
                    viewModel.Title = currentNames[i];
                }
                else if (!string.IsNullOrWhiteSpace(chapter.Name))
                {
                    viewModel.Title = chapter.Name;
                }
                else
                {
                    viewModel.Title = string.Format(
                        CultureInfo.CurrentCulture,
                        EncodingRes.DefaultChapterName,
                        i + 1);
                }

                this.chapterNames.Add(viewModel);

                startTime += chapter.Duration.ToSpan();
            }

            this.useDefaultNames = useDefaultNames;

            this.ImportCsvFile = ReactiveCommand.Create();
            this.ImportCsvFile.Subscribe(_ => this.ImportCsvFileImpl());
        }