Пример #1
0
        private void GetUserDetailsAsyncWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            // verify no exception happened
            if (e.Error != null)
            {
                OnError("Get user details failed. Please try again later.", e.Error);
                return;
            }

            ExtendedUser user = e.Result as ExtendedUser;

            if (null != user)
            {
                _selectedUser = user;
            }

            // raise get user details completed event
            if (null != UserProfileOperationCompleted)
            {
                UserProfileOperationCompletedEventArgs args = new UserProfileOperationCompletedEventArgs {
                    User = user
                };
                UserProfileOperationCompleted(this, args);
            }
        }
Пример #2
0
        private void unfollowUserWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            // check for error
            if (null != e.Error)
            {
                OnError("Unfollow user failed. Please try again later", e.Error);
                return;
            }

            // notify caller follow operation completed, pass back the followed User
            ExtendedUser unfollowedUser = e.Result as ExtendedUser;
            UserProfileOperationCompletedEventArgs args = new UserProfileOperationCompletedEventArgs {
                User = unfollowedUser
            };

            UserProfileOperationCompleted(sender, args);
        }