private string UnsuspendMember(IProvisioningModel model, IMainPresenter presenter) { string errorMessage = string.Empty; IMemberServices service = service = new MemberServices(ApplicationResource.BaseUrl, ApplicationResource.ApiVersion); service.UnSuspendMemberUrl = ApplicationResource.ActionUnsuspendMember; service.UserAgentVersion = ApplicationResource.UserAgent; try { foreach (MemberListViewItemModel item in model.Members.Where(m => m.IsChecked).ToList()) { IServiceResponse response = service.UnSuspendMember(new MemberData() { Email = item.Email }, model.AccessToken); if (response.StatusCode == HttpStatusCode.OK) { if (SyncContext != null) { SyncContext.Post(delegate { presenter.UpdateProgressInfo(string.Format("Unsuspended Member: {0}", item.Email)); }, null); } } else { errorMessage = ErrorMessages.FAILED_TO_UNSUSPEND_MEMBER; } } } catch (Exception) { // error message. SyncContext.Post(delegate { presenter.ShowErrorMessage(ErrorMessages.FAILED_TO_UNSUSPEND_MEMBER, ErrorMessages.DLG_DEFAULT_TITLE); presenter.UpdateProgressInfo(""); presenter.ActivateSpinner(false); presenter.EnableControl(true); }, null); } return errorMessage; }