public static AlbumBrowseResult ConvertToDto(IAlbumBrowse browse) { using(browse) { return Mapper.Map<IAlbumBrowse, AlbumBrowseResult>(browse); } }
internal static IntPtr GetPointer(IAlbumBrowse albumBrowse) { if (albumBrowse.GetType() == typeof(AlbumBrowseWrapper)) { return(((AlbumBrowseWrapper)albumBrowse).albumBrowse.albumBrowsePtr); } throw new ArgumentException("Invalid album browse"); }
// AlbumBrowse methods made Synchronously public static void WaitForCompletion(this IAlbumBrowse albumBrowse) { var reset = new ManualResetEvent(albumBrowse.IsComplete); AlbumBrowseEventHandler handler = (a, e) => reset.Set(); albumBrowse.Complete += handler; reset.WaitOne(); albumBrowse.Complete -= handler; }
public static IAlbumBrowse WaitForCompletion(this IAlbumBrowse browse) { var reset = new ManualResetEvent(browse.IsComplete); EventHandler <UserDataEventArgs> handler = (s, e) => reset.Set(); browse.Completed += handler; reset.WaitOne(); browse.Completed -= handler; return(browse); }
void albumBrowse_Complete(IAlbumBrowse sender, AlbumBrowseEventArgs e) { if (sender == albumBrowse) { if (Complete != null) { Complete(this, e); } } }
public AlbumInformation(IAlbum album, Dispatcher dispatcher) { _tracks = new ObservableCollection<Track>(); _copyrights = new ObservableCollection<string>(); _dispatcher = dispatcher; _album = album; _browse = _album.Browse(); _isLoading = !_browse.IsComplete; _browse.Completed += AlbumBrowseCompleted; }
public AlbumInformation(Artist originalArtist, Album album, Dispatcher dispatcher) { _orginalArtist = originalArtist; _tracks = new NotifyCollection<Track>(); _copyrights = new NotifyCollection<string>(); _dispatcher = dispatcher; _album = album; _browse = _album.InternalAlbum.Browse(); _isLoading = !_browse.IsComplete; if (IsLoading) { _browse.Completed += AlbumBrowseCompleted; } else { AlbumBrowseCompleted(_browse, null); } }
internal AlbumBrowseEventArgs(IAlbumBrowse result) { this.result = result; }
internal AlbumBrowseEventArgs(IAlbumBrowse result, object state) { this.result = result; this.state = state; }
public TopHitsAlbum(IArtist artist, IArray<ITrack> tracks, ISession session) { this.Artist = artist; this.Session = session; browser = new TopHitsAlbumBrowse(this, artist, tracks, session); }
internal AlbumBrowseEventArgs(IAlbumBrowse result) { this.result = result; }
private void LoadDataFromBrowse(IAlbumBrowse browse) { using (browse) { foreach (var copyright in browse.Copyrights) { _copyrights.Add(copyright); } foreach (var spotifyTrack in browse.Tracks) { _tracks.Add(new Track(spotifyTrack, _dispatcher)); } } IsLoading = false; }
private void LoadDataFromBrowse(IAlbumBrowse browse) { using (browse) { foreach (var copyright in browse.Copyrights) { _copyrights.Add(copyright); } foreach (var spotifyTrack in browse.Tracks) { if (_orginalArtist != null && _orginalArtist.Name != spotifyTrack.Album.Artist.Name) { _album.ChangeAlbumType(Infrastructure.Interfaces.AlbumType.Compilation); } _tracks.Add(new Track(spotifyTrack, _dispatcher)); } } IsLoading = false; OnLoaded(); }