private void DumpFiles(IDumpUserContentModel model, IMainPresenter presenter) { if (SyncContext != null) { SyncContext.Post(delegate { presenter.UpdateProgressInfo("Preparing Download..."); }, null); } string ProvisionToken = ApplicationResource.DefaultProvisionToken; int counter = 0; int total = model.MemberList.Where(d => d.IsChecked && !string.IsNullOrEmpty(d.FileName)).ToList().Count; IMemberServices service = new MemberServices(ApplicationResource.ContentUrl, ApplicationResource.ApiVersion); service.FileDumpUrl = ApplicationResource.ActionFilesDownload; service.UserAgentVersion = ApplicationResource.UserAgent; foreach (TeamListViewItemModel lvItem in model.MemberList) { if (lvItem.IsChecked && !string.IsNullOrEmpty(lvItem.FileName)) { // notify progress if (SyncContext != null) { SyncContext.Post(delegate { presenter.UpdateProgressInfo(string.Format("Downloading File: {0}/{1}", ++counter, total)); }, null); } service.DumpFile( new MemberData() { Email = lvItem.Email, Path = lvItem.FilePath, FileName = lvItem.FileName, MemberId = lvItem.TeamId, ZipFiles = model.ZipFiles }, model.OutputFolder, model.UserAccessToken ); if (model.SuspendUser) { IMemberServices serviceSus = new MemberServices(ApplicationResource.BaseUrl, ApplicationResource.ApiVersion); serviceSus.SuspendMemberUrl = ApplicationResource.ActionSuspendMember; serviceSus.UserAgentVersion = ApplicationResource.UserAgent; IServiceResponse response = serviceSus.SuspendMember(new MemberData() { Email = lvItem.Email }, ProvisionToken); if (response.StatusCode == HttpStatusCode.OK) { if (SyncContext != null) { SyncContext.Post(delegate { presenter.UpdateProgressInfo(string.Format("Suspended Member: {0}", lvItem.Email)); }, null); } } else { if (SyncContext != null) { SyncContext.Post(delegate { presenter.UpdateProgressInfo(string.Format(ErrorMessages.FAILED_TO_SUSPEND_MEMBER)); }, null); } } } if (model.DeleteUser) { IMemberServices serviceDel = new MemberServices(ApplicationResource.BaseUrl, ApplicationResource.ApiVersion); serviceDel.RemoveMemberUrl = ApplicationResource.ActionRemoveMember; serviceDel.UserAgentVersion = ApplicationResource.UserAgent; IServiceResponse response = serviceDel.RemoveMember(new MemberData() { Email = lvItem.Email, KeepAccount = model.KeepAccount }, ProvisionToken); if (response.StatusCode == HttpStatusCode.OK) { if (SyncContext != null) { SyncContext.Post(delegate { presenter.UpdateProgressInfo(string.Format("Removed Member: {0}", lvItem.Email)); }, null); } } else { if (SyncContext != null) { SyncContext.Post(delegate { presenter.UpdateProgressInfo(string.Format(ErrorMessages.FAILED_TO_REMOVE_MEMBER)); }, null); } } } } } }