Beispiel #1
0
        /// <summary>
        /// The merge with database.
        /// </summary>
        /// <param name="importDatabase">
        /// The import database.
        /// </param>
        public static void MergeWithDatabase(
            BindingList <MovieModel> importDatabase, MovieDBTypes type = MovieDBTypes.Movies)
        {
            foreach (MovieModel movie in importDatabase)
            {
                if (movie.SmallPoster != null)
                {
                    movie.SmallPoster = ImageHandler.ResizeImage(movie.SmallPoster, 100, 150);
                }

                switch (type)
                {
                case MovieDBTypes.Movies:
                    MovieDatabase.Add(movie);
                    break;

                case MovieDBTypes.Duplicates:
                    DuplicatedMoviesDatabase.Add(movie);
                    break;

                default:
                    break;
                }
            }

            if (type == MovieDBTypes.Movies)
            {
                MediaPathDBFactory.GetMediaPathMoviesUnsorted().Clear();
                GeneratePictureGallery();
            }
        }
Beispiel #2
0
        public static void RestoreHiddenMovie(MovieModel movieModel)
        {
            HiddenMovieDatabase.Remove(movieModel);
            movieModel.Hidden = false;
            MovieDatabase.Add(movieModel);

            DatabaseIOFactory.DatabaseDirty = true;
        }
Beispiel #3
0
        private void OnMovieAdd(object sender, EventArgs e)
        {
            var form = new MovieDetailForm("Add Movie");

            if (form.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            _database.Add(form.Movie);
            //if (!String.IsNullOrEmpty(message))
            //    MessageBox.Show(message);

            RefreshUI();
        }
Beispiel #4
0
        /// <summary>
        /// The merge with database.
        /// </summary>
        /// <param name="importDatabase">
        /// The import database.
        /// </param>
        public static void MergeWithDatabase(BindingList <MovieModel> importDatabase)
        {
            foreach (MovieModel movie in importDatabase)
            {
                if (movie.SmallPoster != null)
                {
                    movie.SmallPoster = Tools.ResizeImage(movie.SmallPoster, 100, 150);
                }

                MovieDatabase.Add(movie);
            }

            MediaPathDBFactory.GetMediaPathMoviesUnsorted().Clear();
            GeneratePictureGallery();
        }
Beispiel #5
0
        private void OnMovieAdd(object sender, EventArgs e)
        {
            var form = new MovieDetailForm("Add Movie");

            if (form.ShowDialog(this) == DialogResult.Cancel)
            {
                return;
            }
            _database.Add(form.Movie, out var message);
            if (!String.IsNullOrEmpty(message))
            {
                MessageBox.Show(message);
                OnMovieAdd(sender, e);
            }
            RefreshUI();
        }