Пример #1
0
        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) }));
            }
        }
Пример #2
0
        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) }));
            }
        }
Пример #3
0
 internal ArtistBrowseEventArgs(ArtistBrowse result, object state)
 {
     this.result = result;
     this.state  = state;
 }
		internal ArtistBrowseEventArgs(ArtistBrowse result, object state)
		{
			this.result = result;
			this.state = state;
		}
Пример #5
0
 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)));
 }