/// <summary> /// Remove a Movie /// Remove all references to this movies in all heroes /// </summary> /// <param name="movie"></param> /// <returns></returns> public bool RemoveMovie(ISearchableMovie movie) { foreach (Hero h in this.ListHeros) { int index = h.ListMovies.FindIndex(mov => mov.GetId() == movie.GetId()); if (index != -1) { h.ListMovies.RemoveAt(index); } } this.ListMovies.Remove(movie); return(true); }
/// <summary> /// Add a movie /// Create all references to this movie in all heroes /// </summary> /// <param name="movie"></param> /// <returns></returns> public bool AddMovie(ISearchableMovie movie) { foreach (string hero in movie.GetHeroString()) { int index = this.ListHeros.FindIndex(h => h.Id == hero); if (index != -1) { movie.AddListHero(this.ListHeros[index]); this.ListHeros[index].ListMovies.Add((Movie)movie); } } this.ListMovies.Add((ISearchableMovie)movie); return(true); }
public void SendNavigateMovie(ISearchableMovie movie) { MessengerInstance.Send <MovieMessage>(new MovieMessage(this, movie, "Navigate Movie Message")); }
public HistoryObject(string NomVM, ISearchableMovie Movie) { this.NomVM = NomVM; this.Hero = null; this.Movie = Movie; }
public HistoryObject(string NomVM, Hero Hero) { this.NomVM = NomVM; this.Hero = Hero; this.Movie = null; }
public HistoryObject(ViewModelBase Source) { this.NomVM = Source.GetType().Name; this.Hero = this.NomVM == "HeroViewModel" ? ((HeroViewModel)Source).Hero : null; this.Movie = this.NomVM == "FilmViewModel" ? ((FilmViewModel)Source).Movie : null; }
public HistoryObject(string NomVM) { this.NomVM = NomVM; this.Hero = null; this.Movie = null; }
public MovieMessage(object sender, object target, ISearchableMovie movie, string status) : base(sender, target) { Movie = movie; Status = status; }
public MovieMessage(ISearchableMovie movie, string status) : base() { Movie = movie; Status = status; }
/// <summary> /// Update a Movie in the List /// Remove old + Add new /// makes sure it doesn't create not linked movie (because of ID changes etc) /// </summary> /// <param name="movie"></param> /// <returns></returns> public bool UpdateMovie(ISearchableMovie movieNew, ISearchableMovie movieOld) { RemoveMovie(movieOld); AddMovie(movieNew); return(true); }
public HistoryMessage(object sender, object target, ISearchableMovie movie, string status) : base(sender, target) { Hero = null; Movie = movie; Status = status; }
public HistoryMessage(ISearchableMovie movie, string status) : base() { Hero = null; Movie = movie; Status = status; }