/// <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(); } }
public static void RestoreHiddenMovie(MovieModel movieModel) { HiddenMovieDatabase.Remove(movieModel); movieModel.Hidden = false; MovieDatabase.Add(movieModel); DatabaseIOFactory.DatabaseDirty = true; }
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(); }
/// <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(); }
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(); }