protected virtual async Task HandleAddPlaylistElement(AddPlaylistElementEvent e) { if (e.Playlist == null) { e.Playlist = await CreateNewPlaylistVM(); if (e.Playlist == null) { return; } } foreach (var item in e.PlaylistElements) { if (item is TimelineEventVM timelineEventVM) { e.Playlist.ViewModels.Add(new PlaylistPlayElementVM() { Model = new PlaylistPlayElement(timelineEventVM.Model.Clone()), }); } else { e.Playlist.ViewModels.Add((PlaylistElementVM)item); } } Save(e.Playlist, true); }
//FIXME: fix playlist/project logic and use PlaylistController HandleAddPlaylistElement after MVVMC refactor protected override Task HandleAddPlaylistElement(AddPlaylistElementEvent e) { if (e.Playlist == null) { e.Playlist = HandleNewPlaylist( new NewPlaylistEvent { Project = OpenedProject } ); if (e.Playlist == null) { return(AsyncHelpers.Return(true)); } } foreach (var item in e.PlaylistElements) { e.Playlist.Elements.Add(item); } return(AsyncHelpers.Return(true)); }
// For some reason, without this override, these 3 tests fail: // TestAddEventsToExistingPlaylistWithStorage // TestAddEventsToNewPlaylistWithProject // TestAddEventsToNewPlaylistWithStorage protected override Task HandleAddPlaylistElement(AddPlaylistElementEvent e) { return(base.HandleAddPlaylistElement(e)); }
//FIXME: fix playlist/project logic and use PlaylistController HandleAddPlaylistElement after MVVMC refactor protected override Task HandleAddPlaylistElement(AddPlaylistElementEvent e) { if (e.Playlist == null) { e.Playlist = HandleNewPlaylist ( new NewPlaylistEvent { Project = OpenedProject } ); if (e.Playlist == null) { return AsyncHelpers.Return (true); } } foreach (var item in e.PlaylistElements) { e.Playlist.Elements.Add (item); } return AsyncHelpers.Return (true); }