Beispiel #1
0
        public IAsyncResult BeginLogin(LoginParameters loginParams, AsyncCallback userCallback, object stateObject)
        {
            AsyncLoginResult result = new AsyncLoginResult(userCallback, stateObject);

            this.LoggedIn += result.HandleLoggedIn;

            ThrowHelper.ThrowIfError(LibSpotify.sp_session_login_r(Handle, loginParams.UserName,
                                                                   loginParams.Password, loginParams.RememberMe, IntPtr.Zero));

            return(result);
        }
Beispiel #2
0
 public Task LoginAsync(LoginParameters loginParams, object stateObject)
 {
     return(Task.Factory.FromAsync <LoginParameters>(BeginLogin, EndLogin, loginParams, stateObject));
 }