Example #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);
        }
Example #2
0
        public void EndLogin(IAsyncResult result)
        {
            AsyncLoginResult loginResult = ThrowHelper.DownCast <AsyncLoginResult>(result, "result");

            loginResult.WaitAndCheckPendingException();
        }