private void ArtistBrowseCompleteCallback(IntPtr artistBrowsePtr, IntPtr userDataPtr) { try { ArtistBrowse artistBrowse = new ArtistBrowse(artistBrowsePtr); int id = userDataPtr.ToInt32(); object state = states.ContainsKey(id) ? states[id] : null; if (id <= short.MaxValue) { states.Remove(id); EnqueueEventWorkItem(new EventWorkItem(OnArtistBrowseComplete, new object[] { this, new ArtistBrowseEventArgs(artistBrowse, state) })); } else { if (state != null && state is ManualResetEvent) { states[id] = artistBrowse; (state as ManualResetEvent).Set(); } } } catch (Exception ex) { EnqueueEventWorkItem(new EventWorkItem(OnLogMessage, new object[] { this, new SessionEventArgs("E " + ex.Message) })); } }
private void ArtistBrowseCompleteCallback(IntPtr artistBrowsePtr, IntPtr userDataPtr) { try { ArtistBrowse artistBrowse = new ArtistBrowse(artistBrowsePtr); int id = userDataPtr.ToInt32(); object state = states.ContainsKey(id) ? states[id] : null; if (id <= short.MaxValue) { states.Remove(id); EnqueueEventWorkItem(new EventWorkItem(OnArtistBrowseComplete, new object[] { this, new ArtistBrowseEventArgs(artistBrowse, state) })); } else { if (state != null && state is ManualResetEvent) { states[id] = artistBrowse; (state as ManualResetEvent).Set(); } } } catch(Exception ex) { EnqueueEventWorkItem(new EventWorkItem(OnLogMessage, new object[] { this, new SessionEventArgs("E " + ex.Message) })); } }
internal ArtistBrowseEventArgs(ArtistBrowse result, object state) { this.result = result; this.state = state; }
public static Link FromArtistBrowsePortrait(ArtistBrowse artistBrowse, int index) { ThrowHelper.ThrowIfNull(artistBrowse, "artistBrowse"); return(new Link(LibSpotify.sp_link_create_from_artistbrowse_portrait_r(artistBrowse.Handle, index))); }