public UpdateAnime(MainWindow main) { this.main = main; previous = main.animeShown; InitializeComponent(); setBackground(); loadFields(); }
public AddEpisode(MainWindow main) { this.main = main; path = main.pathStart + "/" + main.animeShown.Directory; selected = main.animeShown; InitializeComponent(); setBackground(); }
private void btn_update_Click(object sender, RoutedEventArgs e) { string s = tbox_year.Text; int year = s.Trim() == "" ? 42 : Convert.ToInt32(s); Anime next = new Anime(tbox_name.Text, tbox_season.Text, tbox_studio.Text, tbox_fansubs.Text, year, previous.NumberOfEpisode, cbox_language.Text, cbox_sub.Text, tbox_synopsis.Text, tbox_type.Text, "Anime/" + tbox_name + " - " + tbox_season); if (!next.StrictEquals(previous)) { main.animes.update(previous, next); MessageBox.Show("Mise à jour effectuée !", "OK"); } this.Close(); }
public bool Equals(Anime a) { return Name == a.Name && Season == a.Season && Language == a.Language && Sub == a.Sub; }
public bool StrictEquals(Anime a) { return a.toString() == this.toString(); }