private void PlayVideo(string file) { if (String.IsNullOrEmpty(file)) { return; } var movie = new Movie(file); var savedMovie = this._fileHelper.GetSavedMovie(file); if (savedMovie != null && savedMovie.Position > TimeSpan.Zero) { var pos = SelectMoviePositionWindow.DefineMoviePosition(savedMovie); if (pos.Span == null) { return; } movie.Position = pos.Span.Value; } this.PlayMovie(movie); }
private void SelectMovieListItem(object item) { if (item is Folder) { var folder = (Folder)item; if (folder.IsParent) { this.LevelUp(); } else { this.FileHelper.GetMovieList(((Folder)item).Path); if (this.MovieListBox.Items.Count > 0) { this.MovieListBox.SelectedIndex = 0; this.FocusSelectedFolder(); } this.MovieListBox.Items.Refresh(); } } else if (item is Movie) { this.Movie = (Movie)item; var savedMovie = this.FileHelper.GetSavedMovie(this.Movie.Path); if (savedMovie != null && savedMovie.Position > TimeSpan.Zero) { var pos = SelectMoviePositionWindow.DefineMoviePosition(savedMovie); if (pos.Span == null) { return; } this.Movie.Position = pos.Span.Value; } this.DialogResult = true; this.Close(); } }