public override void Initialize() { _browseComplete = new Spotify.ToplistBrowseCompleteCallback(OnBrowseCompleteCallback); _tracks = new DelegateArray <ITrack>(GetNumberOfTracks, GetTrackAtIndex); _albums = new DelegateArray <IAlbum>(GetNumberOfAlbums, GetAlbumAtIndex); _artists = new DelegateArray <IArtist>(GetNumberOfArtists, GetArtistAtIndex); if (_userData != null) { _userDataHandle = GCHandle.Alloc(_userData); } lock (Spotify.Mutex) { Handle = Spotify.sp_toplistbrowse_create( Session.GetHandle(), _toplistType, _region, _userName, _browseComplete, _userDataHandle.IsAllocated ? GCHandle.ToIntPtr(_userDataHandle) : IntPtr.Zero); } }
public override void Initialize() { _browseComplete = new Spotify.ToplistBrowseCompleteCallback(OnBrowseCompleteCallback); _tracks = new DelegateArray<ITrack>(GetNumberOfTracks, GetTrackAtIndex); _albums = new DelegateArray<IAlbum>(GetNumberOfAlbums, GetAlbumAtIndex); _artists = new DelegateArray<IArtist>(GetNumberOfArtists, GetArtistAtIndex); if (_userData != null) { _userDataHandle = GCHandle.Alloc(_userData); } lock (Spotify.Mutex) { Handle = Spotify.sp_toplistbrowse_create( Session.GetHandle(), _toplistType, _region, _userName, _browseComplete, _userDataHandle.IsAllocated ? GCHandle.ToIntPtr(_userDataHandle) : IntPtr.Zero); } }