コード例 #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();
 }