public static TopListBrowse Create(SpotifySession session, TopListType type, TopListRegion region, string username, TopListBrowseComplete callback, object userdata) { using (var utf8_username = SpotifyMarshalling.StringToUtf8(username)) { IntPtr listenerToken = ListenerTable.PutUniqueObject(callback, userdata); IntPtr ptr = NativeMethods.sp_toplistbrowse_create(session._handle, type, region, utf8_username.IntPtr, TopListBrowseCompleteDelegate, listenerToken); TopListBrowse browse = BrowseTable.GetUniqueObject(ptr); browse.ListenerToken = listenerToken; return browse; } }
public static TopListBrowse Create(SpotifySession session, TopListType type, TopListRegion region, string username, TopListBrowseComplete callback, object userdata) { using (var utf8_username = SpotifyMarshalling.StringToUtf8(username)) { IntPtr listenerToken = ListenerTable.PutUniqueObject(callback, userdata); IntPtr ptr = NativeMethods.sp_toplistbrowse_create(session._handle, type, region, utf8_username.IntPtr, TopListBrowseCompleteDelegate, listenerToken); TopListBrowse browse = BrowseTable.GetUniqueObject(ptr); browse.ListenerToken = listenerToken; return(browse); } }