private void ExecuteAction() { using (var documentAttachmentService = new WebClientDocumentAttachmentService(OAuthClient.Authorization)) using (var dropboxService = new DropboxClientService()) { switch (Action.Value) { case "Load": LoadAttachments(documentAttachmentService); LoadDropboxItenns(dropboxService); break; case "Transfer": if (String.IsNullOrWhiteSpace(DocumentID.Value)) { NavigateToDocumentList(); } else { TransferFile(dropboxService, documentAttachmentService); } break; } } }
private void TransferFile(DropboxClientService dropboxService, WebClientDocumentAttachmentService documentAttachmentService) { var dropboxFile = dropboxService.GetFileContent(DropboxItems.SelectedValue).Result; documentAttachmentService.Add(new Guid(DocumentID.Value), dropboxFile.FileName, dropboxFile.Content); NavigateToDocumentList(); }
private void LoadDropboxItenns(DropboxClientService dropboxService) { DropboxItems.DataSource = dropboxService.GetDropboxItems().Result; DropboxItems.DataBind(); }