Пример #1
0
        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;
                    }
                }
        }
Пример #2
0
        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();
        }
Пример #3
0
 private void LoadDropboxItenns(DropboxClientService dropboxService)
 {
     DropboxItems.DataSource = dropboxService.GetDropboxItems().Result;
     DropboxItems.DataBind();
 }