コード例 #1
0
        private void SaveFoundContacts()
        {
            RunOnUiThread(() =>
            {
                Toast.MakeText(context, Resource.String.chooseFriendsAddingSelectedContacts, ToastLength.Short);
            });
            AccountOAuth accountOAuth = new AccountOAuth();

            try
            {
                this.Provider.GetUserInfoObject(accountOAuth);
            } catch (Exception ex)
            {

            #if(DEBUG)
                System.Diagnostics.Debug.WriteLine("Error retrieving user info object.");
            #endif
                string m = string.Format("{0} {1}",
                        Application.Context.GetString(Resource.String.errorSavingContacts),
                        ex.Message);
                RunOnUiThread(() => GeneralUtils.Alert(context, Application.Context.GetString(Resource.String.commonError), m));
                return;
            }

            LOLConnectClient service = new LOLConnectClient(LOLConstants.DefaultHttpBinding, LOLConstants.LOLConnectEndpoint);
            service.AccountOAuthCreateCompleted += this.Service_AccountOAuthCreateCompleted;
            service.AccountOAuthCreateAsync(AndroidData.CurrentUser.AccountID,
                                            accountOAuth.OAuthType,
                                            accountOAuth.OAuthID,
                                            accountOAuth.OAuthToken,
                                            new Guid(AndroidData.ServiceAuthToken));
        }