public async Task CreateMovieAsync(Library library) { Ensure.NotNull(library, "library"); if (movieEdit == null) { movieEdit = new MovieEditWindow(this, changeTracker, library, null); movieEdit.Closed += OnMovieEditClosed; StartupLocation(movieEdit); movieEdit.Show(); } movieEdit.Activate(); }
public async Task EditMovieAsync(Library library, IKey movieKey) { Ensure.NotNull(library, "library"); Ensure.Condition.NotEmptyKey(movieKey); if (movieEdit == null) { movieEdit = new MovieEditWindow(this, changeTracker, library, library.Movies.FindByKey(movieKey)); movieEdit.Closed += OnMovieEditClosed; StartupLocation(movieEdit); movieEdit.Show(); } movieEdit.Activate(); }
private void OnMovieEditClosed(object sender, EventArgs e) { movieEdit.Closed -= OnMovieEditClosed; movieEdit = null; }