Esempio n. 1
0
        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);
        }
        internal static MoviePosition DefineMoviePosition(Movie movie)
        {
            var selectPositionWnd = new SelectMoviePositionWindow();

            var result = selectPositionWnd.ShowDialog();

            var pos = new MoviePosition();

            if (result != true)
            {
                return(pos);
            }

            pos.Span = selectPositionWnd.PlayType == PlayType.Continue ? movie.Position : TimeSpan.Zero;

            return(pos);
        }
Esempio n. 3
0
        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();
            }
        }