private void OnAddMultimediaToPlaylistResult(AddLibraryItemToPlaylistResultData result) { bool success = result.Success; MultimediaItem multimedia = (MultimediaItem)result.LibraryItem; AddingLibraryItemToPlaylistResultEventArgs eventArgs = new AddingLibraryItemToPlaylistResultEventArgs(success, multimedia); AddingLibraryItemToPlaylistResult(this, eventArgs); }
private void OnAddingLibraryItemToPlaylistResult(object sender, AddingLibraryItemToPlaylistResultEventArgs eventArgs) { bool success = eventArgs.Result; MultimediaItem multimedia = eventArgs.Multimedia; if (actualPlaylist.Count <= 1) { return; } IList <MultimediaItem> newPlaylist = new List <MultimediaItem>(actualPlaylist); newPlaylist.Add(multimedia); UpdatePlaylist(newPlaylist); ItemAddedEventArgs itemAddedEventArgs = new ItemAddedEventArgs(success, multimedia); messageQueue.Post(() => ItemAdded(this, itemAddedEventArgs)); }