├── generator ├── requirements-dev.txt ├── generate_routes.py └── generator.pyproj ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.md │ ├── question_help.md │ └── bug_report.md ├── pull_request_template.md ├── dependabot.yml └── workflows │ ├── nuget_upload.yml │ └── spec_update.yml ├── icon.png ├── .gitmodules ├── doc └── icons │ └── blue_dropbox_glyph.png ├── dropbox-sdk-dotnet ├── Examples │ ├── SimpleBlogDemo │ │ ├── Views │ │ │ ├── _ViewStart.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── _LoginPartial.cshtml │ │ │ │ └── _Layout.cshtml │ │ │ ├── Home │ │ │ │ ├── Index.cshtml │ │ │ │ ├── SignIn.cshtml │ │ │ │ └── Register.cshtml │ │ │ ├── Blogs │ │ │ │ ├── Index.cshtml │ │ │ │ └── Display.cshtml │ │ │ ├── Web.config │ │ │ └── Edit │ │ │ │ ├── Index.cshtml │ │ │ │ └── Add.cshtml │ │ ├── Global.asax │ │ ├── Scripts │ │ │ ├── _references.js │ │ │ └── preview.js │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ └── glyphicons-halflings-regular.woff │ │ ├── App_Start │ │ │ ├── FilterConfig.cs │ │ │ ├── BundleConfig.cs │ │ │ └── RouteConfig.cs │ │ ├── Models │ │ │ └── UserProfile.cs │ │ ├── README.md │ │ ├── Helpers │ │ │ ├── MaybeRequireHttps.cs │ │ │ ├── ModelHelpers.cs │ │ │ └── FlashHelpers.cs │ │ ├── Content │ │ │ └── Site.css │ │ ├── Web.Debug.config │ │ ├── Web.Release.config │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── packages.config │ │ ├── Global.asax.cs │ │ └── Controllers │ │ │ └── BlogsController.cs │ ├── SimpleBusinessDashboard │ │ ├── Views │ │ │ ├── _ViewStart.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ └── _Layout.cshtml │ │ │ └── Web.config │ │ ├── Global.asax │ │ ├── Images │ │ │ ├── blue-bg.png │ │ │ ├── body-bg.png │ │ │ ├── white-bg.png │ │ │ ├── dropbox-logo.png │ │ │ └── dropbox-logo.txt.svg │ │ ├── Scripts │ │ │ ├── _references.js │ │ │ ├── morris-data.js │ │ │ └── sb-admin-2.js │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ └── glyphicons-halflings-regular.woff │ │ ├── App_Start │ │ │ ├── FilterConfig.cs │ │ │ ├── RouteConfig.cs │ │ │ └── BundleConfig.cs │ │ ├── Content │ │ │ └── morris.css │ │ ├── README.md │ │ ├── Global.asax.cs │ │ ├── Web.Debug.config │ │ ├── Web.Release.config │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── packages.config │ │ └── Helpers │ │ │ └── FlashHelpers.cs │ ├── UniversalDemo │ │ └── UniversalDemo │ │ │ ├── UniversalDemo.Windows │ │ │ ├── Assets │ │ │ │ ├── Logo.scale-100.png │ │ │ │ ├── SmallLogo.scale-100.png │ │ │ │ ├── StoreLogo.scale-100.png │ │ │ │ └── SplashScreen.scale-100.png │ │ │ ├── Settings.StyleCop │ │ │ ├── packages.config │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── Package.appxmanifest │ │ │ ├── DropboxSettings.xaml │ │ │ ├── MainPage.xaml.cs │ │ │ └── MainPage.xaml │ │ │ ├── UniversalDemo.WindowsPhone │ │ │ ├── Assets │ │ │ │ ├── Logo.scale-240.png │ │ │ │ ├── SmallLogo.scale-240.png │ │ │ │ ├── StoreLogo.scale-240.png │ │ │ │ ├── WideLogo.scale-240.png │ │ │ │ ├── SplashScreen.scale-240.png │ │ │ │ └── Square71x71Logo.scale-240.png │ │ │ ├── Settings.StyleCop │ │ │ ├── packages.config │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── SettingsDialog.xaml │ │ │ ├── Package.appxmanifest │ │ │ ├── MainPage.xaml │ │ │ └── SettingsDialog.xaml.cs │ │ │ └── UniversalDemo.Shared │ │ │ ├── App.xaml │ │ │ ├── Settings.StyleCop │ │ │ ├── UniversalDemo.Shared.shproj │ │ │ ├── UniversalDemo.Shared.projitems │ │ │ ├── ViewModel │ │ │ └── ViewModelBase.cs │ │ │ └── BoolToVisibilityConverter.cs │ ├── OAuthPKCE │ │ ├── index.html │ │ ├── packages.config │ │ ├── Settings.settings │ │ ├── App.config │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── Settings.Designer.cs │ ├── OauthBasic │ │ ├── index.html │ │ ├── packages.config │ │ ├── Settings.settings │ │ ├── App.config │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── Settings.Designer.cs │ └── SimpleTest │ │ ├── index.html │ │ ├── packages.config │ │ ├── Settings.settings │ │ ├── App.config │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── Settings.Designer.cs ├── Dropbox.Api │ ├── dropbox_api_key.snk │ ├── packages.config │ ├── stone_summaries.xml │ ├── app.config │ ├── Stone │ │ ├── Empty.cs │ │ ├── IEncoder.cs │ │ └── IDecoder.cs │ ├── Generated │ │ ├── AuthException.cs │ │ ├── PathRootException.cs │ │ ├── AccessException.cs │ │ ├── RateLimitException.cs │ │ ├── DropboxTeamClient.cs │ │ ├── DropboxAppClient.cs │ │ ├── Auth │ │ │ └── AuthUserRoutes.cs │ │ ├── Openid │ │ │ └── UserInfoArgs.cs │ │ └── TeamLog │ │ │ ├── FileAddDetails.cs │ │ │ ├── FileEditDetails.cs │ │ │ ├── TfaResetDetails.cs │ │ │ ├── GroupMovedDetails.cs │ │ │ ├── NoteSharedDetails.cs │ │ │ ├── FileDeleteDetails.cs │ │ │ ├── FileRevertDetails.cs │ │ │ ├── FilePreviewDetails.cs │ │ │ └── CreateFolderDetails.cs │ ├── ApiException.cs │ ├── Dropbox.Api.csproj │ ├── Dropbox.Api.nuspec │ ├── DropboxClientBase.cs │ ├── DropboxClientConfig.cs │ └── DropboxAppClient.cs ├── stylecop.json ├── Dropbox.Api.Integration.Tests │ ├── settings.json.example │ ├── Dropbox.Api.Integration.Tests.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── MockHttpMessageHandler.cs ├── stylecop.ruleset ├── Dropbox.Api.Unit.Tests │ ├── packages.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Dropbox.Api.Unit.Tests.csproj │ └── StoneTests.cs └── .editorconfig ├── scripts ├── util.ps1 ├── update_version.sh └── release_note_generator.sh ├── CODE_OF_CONDUCT.md ├── .gitignore ├── LICENSE └── .gitattributes /generator/requirements-dev.txt: -------------------------------------------------------------------------------- 1 | stone 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/icon.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "spec"] 2 | path = spec 3 | url = https://github.com/dropbox/dropbox-api-spec.git 4 | -------------------------------------------------------------------------------- /doc/icons/blue_dropbox_glyph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/doc/icons/blue_dropbox_glyph.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/dropbox_api_key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Dropbox.Api/dropbox_api_key.snk -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="SimpleBlogDemo.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | "settings": { 3 | "documentationRules": { 4 | "companyName": "Dropbox Inc" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="SimpleBusinessDashboard.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Scripts/_references.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Scripts/_references.js -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Images/blue-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Images/blue-bg.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Images/body-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Images/body-bg.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Images/white-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Images/white-bg.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Images/dropbox-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Images/dropbox-logo.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Scripts/_references.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Scripts/_references.js -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests/settings.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "appKey": "", 3 | "appSecret": "", 4 | "userAccessToken": "", 5 | "userRefreshToken": "", 6 | "teamAccessToken": "" 7 | } 8 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/SimpleBlogDemo/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/SimpleBlogDemo/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/SimpleBlogDemo/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/Assets/Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/Assets/Logo.scale-100.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/Assets/SmallLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/Assets/SmallLogo.scale-100.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/Assets/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/Assets/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Assets/Logo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Assets/Logo.scale-240.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Assets/SmallLogo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Assets/SmallLogo.scale-240.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Assets/StoreLogo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Assets/StoreLogo.scale-240.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Assets/WideLogo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Assets/WideLogo.scale-240.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Assets/SplashScreen.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Assets/SplashScreen.scale-240.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Assets/Square71x71Logo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-sdk-dotnet/main/dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Assets/Square71x71Logo.scale-240.png -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Settings.StyleCop: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dropbox 5 | 6 | 7 | -------------------------------------------------------------------------------- /scripts/util.ps1: -------------------------------------------------------------------------------- 1 | function EnsureCommand() 2 | { 3 | param ( 4 | [string] $commandName 5 | ) 6 | 7 | if (!(Get-Command "$commandName" -ErrorAction SilentlyContinue)) { 8 | Write-Error "Cannot find $commandName, please ensure it exists on your PATH" -ErrorAction Stop 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Shared/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Dropbox Code Of Conduct 2 | 3 | *Dropbox believes that an inclusive development environment fosters greater technical achievement. To encourage a diverse group of contributors we've adopted this code of conduct.* 4 | 5 | Please read the Official Dropbox [Code of Conduct](https://opensource.dropbox.com/coc/) before contributing. 6 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/OAuthPKCE/index.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/OauthBasic/index.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleTest/index.html: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/Settings.StyleCop: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | auth 5 | Dropbox 6 | flyout 7 | 8 | 9 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace SimpleBlogDemo 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/stylecop.ruleset: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /scripts/update_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -z $1 ]; then 4 | echo "error: $0 needs a version number as argument."; 5 | exit 1 6 | else 7 | set -ex 8 | NEW_VERSION=$1 9 | 10 | git checkout main 11 | git reset --hard HEAD 12 | 13 | git tag "v${NEW_VERSION}" -m "${NEW_VERSION} release" 14 | 15 | git push origin 16 | git push origin --tags 17 | fi -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace SimpleBusinessDashboard 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | 9 | Error 10 | 11 | 12 |
13 |

Error.

14 |

An error occurred while processing your request.

15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/OAuthPKCE/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/OauthBasic/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | 9 | Error 10 | 11 | 12 |
13 |

Error.

14 |

An error occurred while processing your request.

15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleTest/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Content/morris.css: -------------------------------------------------------------------------------- 1 | .morris-hover{position:absolute;z-index:1000}.morris-hover.morris-default-style{border-radius:10px;padding:6px;color:#666;background:rgba(255,255,255,0.8);border:solid 2px rgba(230,230,230,0.8);font-family:sans-serif;font-size:12px;text-align:center}.morris-hover.morris-default-style .morris-hover-row-label{font-weight:bold;margin:0.25em 0} 2 | .morris-hover.morris-default-style .morris-hover-point{white-space:nowrap;margin:0.1em 0} 3 | -------------------------------------------------------------------------------- /scripts/release_note_generator.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | last_version=$(git tag --sort v:refname | tail -n 2 | head -n 1) 4 | echo "Getting commit history since $last_version" 5 | num_commits=$(git rev-list --count $last_version..HEAD) 6 | echo "Found $num_commits commits since last revision" 7 | git_log=$(git log -n $num_commits --pretty="format:* %s %n") 8 | linked_log=$(echo "Release Notes: \n\n$git_log" | sed -e 's/#\([0-9]*\)/[#\1](https:\/\/github.com\/dropbox\/dropbox-sdk-dotnet\/pull\/\1)/g') 9 | echo "\n\n$linked_log" 10 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/stone_summaries.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | _DropboxApiStoneNamespaceSummaries_ 5 | 6 | 7 | 8 | 9 | Contains the definitions for the interfaces used for encoding and transporting stone 10 | api objects. This also includes concrete implementations of those interfaces. 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleTest/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # Added CS0419, CS1574, CS1570, CS0618 on 9/23/20. These should all be removed at some point. Added to get intitial build passing. 4 | 5 | # CS0419: Ambiguous reference in cref attribute 6 | dotnet_diagnostic.CS0419.severity = silent 7 | 8 | # CS1574: XML comment has cref attribute that could not be resolved 9 | dotnet_diagnostic.CS1574.severity = silent 10 | 11 | # CS1570: XML comment has badly formed XML 12 | dotnet_diagnostic.CS1570.severity = silent 13 | 14 | # CS0618: Type or member is obsolete 15 | dotnet_diagnostic.CS0618.severity = silent 16 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 4 | 5 | ## **Checklist** 6 | 7 | 8 | **General Contributing** 9 | - [ ] Have you read the Code of Conduct and signed the [CLA](https://opensource.dropbox.com/cla/)? 10 | 11 | **Is This a Code Change?** 12 | - [ ] Non-code related change (markdown/git settings etc) 13 | - [ ] SDK Code Change 14 | - [ ] Example/Test Code Change 15 | 16 | **Validation** 17 | - [ ] Does this code build successfully? 18 | - [ ] Do all tests pass? 19 | - [ ] Does Stylecop pass? 20 | 21 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "nuget" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "monthly" 12 | 13 | - package-ecosystem: "github-actions" 14 | directory: "/" 15 | schedule: 16 | interval: "monthly" 17 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/OAuthPKCE/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/OauthBasic/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Shared/Settings.StyleCop: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Auth 5 | Dropbox 6 | OAuth 7 | 8 | 9 | 10 | 11 | 12 | Dropbox Inc 13 | Copyright (c) Dropbox Inc. All rights reserved. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("UniversalDemo.Windows")] 6 | [assembly: AssemblyDescription("")] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("Dropbox Inc")] 9 | [assembly: AssemblyProduct("UniversalDemo.Windows")] 10 | [assembly: AssemblyCopyright("Copyright © Dropbox Inc. All rights reserved.")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | 14 | [assembly: AssemblyVersion("1.0.0.0")] 15 | [assembly: AssemblyFileVersion("1.0.0.0")] 16 | [assembly: ComVisible(false)] 17 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Scripts/morris-data.js: -------------------------------------------------------------------------------- 1 | //$(function () { 2 | // var d = new Date() 3 | // var dataList = []; 4 | 5 | // for (var i = 6; i >= 0; i--) { 6 | // var map = {}; 7 | // map["y"] = (d.getMonth() + 1) + "/" + (d.getDate() - i) + "/" + d.getFullYear(); 8 | // map["a"] = 100; 9 | // dataList.push(map); 10 | // } 11 | 12 | // var dataInput = JSON.parse(JSON.stringify(dataList)); 13 | 14 | // Morris.Bar({ 15 | // element: 'morris-bar-chart', 16 | // data: dataInput, 17 | // xkey: 'y', 18 | // ykeys: ['a'], 19 | // labels: ['Number Users'], 20 | // hideHover: 'auto', 21 | // resize: true 22 | // }); 23 | 24 | //}); 25 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace SimpleBusinessDashboard 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("UniversalDemo.WindowsPhone")] 6 | [assembly: AssemblyDescription("")] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("Dropbox Inc")] 9 | [assembly: AssemblyProduct("UniversalDemo.WindowsPhone")] 10 | [assembly: AssemblyCopyright("Copyright © Dropbox Inc. All rights reserved.")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | 14 | [assembly: AssemblyVersion("1.0.0.0")] 15 | [assembly: AssemblyFileVersion("1.0.0.0")] 16 | [assembly: ComVisible(false)] 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F680 Feature Request" 3 | about: Suggest an idea for this SDK 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Why is this feature valuable to you? Does it solve a problem you're having?** 11 | A clear and concise description of why this feature is valuable. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. (if applicable) 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question_help.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F4AC Questions / Help" 3 | about: Get help with issues you are experiencing 4 | title: '' 5 | labels: help-wanted, question 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Before you start** 11 | Have you checked StackOverflow, previous issues, and Dropbox Developer Forums for help? 12 | 13 | **What is your question?** 14 | A clear and concise description of the question. 15 | 16 | **Screenshots** 17 | If applicable, add screenshots to help explain your question. 18 | 19 | **Versions** 20 | * What version of the SDK are you using? 21 | * What version of the language are you using? 22 | * What platform are you using? (if applicable) 23 | 24 | **Additional context** 25 | Add any other context about the question here. 26 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using WebMatrix.WebData 2 | @if (WebSecurity.IsAuthenticated) 3 | { 4 | using (Html.BeginForm("LogOff", "Home", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) 5 | { 6 | @Html.AntiForgeryToken() 7 | 8 | 12 | } 13 | } 14 | else 15 | { 16 | 19 | } 20 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Stone/Empty.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Dropbox Inc. All rights reserved. 4 | // 5 | //----------------------------------------------------------------------------- 6 | 7 | namespace Dropbox.Api.Stone 8 | { 9 | /// 10 | /// An empty object used when a route doesn't have one or more of the 11 | /// request, response, or error types specified. 12 | /// 13 | internal sealed class Empty 14 | { 15 | /// 16 | /// A static instance of the class. 17 | /// 18 | public static readonly Empty Instance = new Empty(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F41B Bug report" 3 | about: Create a report to help us improve the SDK 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of the bug. 12 | 13 | **To Reproduce** 14 | The steps to reproduce the behavior 15 | 16 | **Expected Behavior** 17 | A clear description of what you expected to happen. 18 | 19 | **Actual Behavior** 20 | A clear description of what actually happened 21 | 22 | **Screenshots** 23 | If applicable, add screenshots to help explain your problem. 24 | 25 | **Versions** 26 | * What version of the SDK are you using? 27 | * What version of the language are you using? 28 | * What platform are you using? (if applicable) 29 | 30 | **Additional context** 31 | Add any other context about the problem here. 32 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/AuthException.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api 6 | { 7 | using sys = System; 8 | 9 | using Dropbox.Api.Auth; 10 | 11 | /// 12 | /// An HTTP exception that is caused by the server reporting an authentication 13 | /// problem. 14 | /// 15 | public sealed partial class AuthException : StructuredException 16 | { 17 | /// 18 | /// Decode from given json. 19 | /// 20 | internal static AuthException Decode(string json, sys.Func exceptionFunc) 21 | { 22 | return StructuredException.Decode(json, AuthError.Decoder, exceptionFunc); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/PathRootException.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api 6 | { 7 | using sys = System; 8 | 9 | using Dropbox.Api.Common; 10 | 11 | /// 12 | /// An HTTP exception that is caused by invalidDropbox-Api-Path-Root header. 13 | /// 14 | public sealed partial class PathRootException : StructuredException 15 | { 16 | /// 17 | /// Decode from given json. 18 | /// 19 | internal static PathRootException Decode(string json, sys.Func exceptionFunc) 20 | { 21 | return StructuredException.Decode(json, PathRootError.Decoder, exceptionFunc); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/AccessException.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api 6 | { 7 | using sys = System; 8 | 9 | using Dropbox.Api.Auth; 10 | 11 | /// 12 | /// An HTTP exception that is caused by the account notnot having access to the 13 | /// endpoint. 14 | /// 15 | public sealed partial class AccessException : StructuredException 16 | { 17 | /// 18 | /// Decode from given json. 19 | /// 20 | internal static AccessException Decode(string json, sys.Func exceptionFunc) 21 | { 22 | return StructuredException.Decode(json, AccessError.Decoder, exceptionFunc); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.github/workflows/nuget_upload.yml: -------------------------------------------------------------------------------- 1 | name: Publish to NuGet 2 | 3 | on: 4 | workflow_dispatch: 5 | release: 6 | types: [created] 7 | 8 | jobs: 9 | deploy: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - name: Pack 14 | run: | 15 | dotnet pack \ 16 | dropbox-sdk-dotnet/Dropbox.Api \ 17 | -p:Configuration=Release \ 18 | -p:Version=$(echo "${{ github.event.release.tag_name }}" | cut -c 2-) \ 19 | -p:AssemblyOriginatorKeyFile=dropbox_api_key.snk \ 20 | -p:SignAssembly=true 21 | - name: Push 22 | run: | 23 | dotnet nuget push \ 24 | dropbox-sdk-dotnet/Dropbox.Api/bin/Release/Dropbox.Api.$(echo "${{ github.event.release.tag_name }}" | cut -c 2-).nupkg \ 25 | --source https://api.nuget.org/v3/index.json \ 26 | --api-key ${{ secrets.NUGET_TOKEN }} 27 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/RateLimitException.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api 6 | { 7 | using sys = System; 8 | 9 | using Dropbox.Api.Auth; 10 | 11 | /// 12 | /// An HTTP exception that is caused by the client being rate limited by the 13 | /// server. 14 | /// 15 | public sealed partial class RateLimitException : StructuredException 16 | { 17 | /// 18 | /// Decode from given json. 19 | /// 20 | internal static RateLimitException Decode(string json, sys.Func exceptionFunc) 21 | { 22 | return StructuredException.Decode(json, RateLimitError.Decoder, exceptionFunc); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Dropbox Inc. All rights reserved. 3 | // 4 | 5 | using System.Reflection; 6 | using System.Runtime.CompilerServices; 7 | using System.Runtime.InteropServices; 8 | 9 | [assembly: AssemblyTitle("Dropbox.Api.Unit.Tests")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("Dropbox.Api.Unit.Tests")] 14 | [assembly: AssemblyCopyright("Copyright © 2020")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | [assembly: ComVisible(false)] 19 | 20 | [assembly: Guid("eecfd4ad-b7df-4aa7-b067-c6da4139cb46")] 21 | 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion("1.0.0.0")] 24 | [assembly: AssemblyFileVersion("1.0.0.0")] 25 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Stone/IEncoder.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Dropbox Inc. All rights reserved. 4 | // 5 | //----------------------------------------------------------------------------- 6 | 7 | namespace Dropbox.Api.Stone 8 | { 9 | using System; 10 | using System.Collections.Generic; 11 | 12 | /// 13 | /// The encoder interface. 14 | /// 15 | /// The type to encode. 16 | internal interface IEncoder 17 | { 18 | /// 19 | /// Encode given data using provided writer. 20 | /// 21 | /// The value. 22 | /// The writer. 23 | void Encode(T value, IJsonWriter writer); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Stone/IDecoder.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Dropbox Inc. All rights reserved. 4 | // 5 | //----------------------------------------------------------------------------- 6 | 7 | namespace Dropbox.Api.Stone 8 | { 9 | using System; 10 | using System.Collections.Generic; 11 | 12 | /// 13 | /// Interface that is used to decode objects of specific type. 14 | /// 15 | /// The type of the decoded object. 16 | internal interface IDecoder 17 | { 18 | /// 19 | /// Decode into specific type. 20 | /// 21 | /// The json reader. 22 | /// The value. 23 | T Decode(IJsonReader reader); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Models/UserProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Data.Entity; 6 | using System.ComponentModel.DataAnnotations; 7 | using System.ComponentModel; 8 | using System.ComponentModel.DataAnnotations.Schema; 9 | 10 | namespace SimpleBlogDemo.Models 11 | { 12 | public class UserProfile 13 | { 14 | public int ID { get; set; } 15 | 16 | [Required, StringLength(255, MinimumLength = 3)] 17 | public string UserName { get; set; } 18 | 19 | public string DropboxAccessToken { get; set; } 20 | 21 | [RegularExpression("^[A-Za-z][A-Za-z'-']*[A-Za-z]$")] 22 | public string BlogName { get; set; } 23 | 24 | [StringLength(32)] 25 | public string ConnectState { get; set; } 26 | } 27 | 28 | public class UsersStore : DbContext 29 | { 30 | public DbSet Users { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests/settings.json 2 | /venv/ 3 | 4 | ## Visual studio stuff 5 | *.suo 6 | *.user 7 | .vs/ 8 | 9 | #ignore build contents 10 | [dD]ebug/ 11 | [rR]elease/ 12 | [bB]in/ 13 | *[oO]bj/ 14 | [Ll]ast[Bb]uild.log 15 | 16 | # test stuff 17 | [Tt]est[Rr]esult*/ 18 | [Bb]uild[Ll]og.* 19 | App_Data/ 20 | 21 | ## vim files 22 | *.un~ 23 | *~ 24 | 25 | ## nuget packages 26 | /dropbox-sdk-dotnet/packages/ 27 | *.nupkg 28 | .nuget/ 29 | 30 | ##pyc 31 | *.pyc 32 | 33 | ## files containing keys 34 | *.[Dd]o[Nn]ot[Ss]ync.* 35 | *.pfx 36 | 37 | ## Stylecop cache 38 | [Ss]tyle[Cc]op.[Cc]ache 39 | 40 | ## Generated output 41 | ## /dropbox-sdk-dotnet/Dropbox.Api/Generated 42 | 43 | ## Generated csproj files. 44 | ## /dropbox-sdk-dotnet/Dropbox.Api/*.csproj 45 | 46 | ## Generated docs 47 | /doc/Help 48 | 49 | ## App Packages 50 | AppPackages/ 51 | 52 | # IntelliJ stuff 53 | .idea/ 54 | 55 | # Visual studio stuff 56 | /dropbox-sdk-dotnet/UpgradeLog*.htm 57 | /dropbox-sdk-dotnet/.vs/ 58 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Scripts/preview.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | $('#preview').prop('disabled', false).click(function (e) { 3 | var markdown = $('#content').val(); 4 | $.ajax('/Preview', { 5 | method: 'POST', 6 | data: { 7 | __RequestVerificationToken: $('input[name=__RequestVerificationToken]').val(), 8 | markdown: markdown 9 | } 10 | }).done(function (msg) { 11 | $('#preview-loading').hide(); 12 | $('#preview-content').show().html(msg); 13 | }).fail(function (jqXHR, textStatus) { 14 | $('#preview-loading').hide(); 15 | $('#preview-content').show().text("There was an error generating a preview.").addClass('text-danger'); 16 | }); 17 | $('#preview-modal').modal(); 18 | $('#preview-loading').show(); 19 | $('#preview-content').hide().removeClass('text-danger'); 20 | 21 | e.preventDefault(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/SettingsDialog.xaml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 16 | 17 | You are currently connected to Dropbox. 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /generator/generate_routes.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import absolute_import, division, print_function 3 | 4 | import glob 5 | import os 6 | import shutil 7 | import subprocess 8 | 9 | 10 | def main(): 11 | """The entry point for the program.""" 12 | generator_path = os.path.abspath('generator') 13 | spec_path = os.path.abspath('spec') 14 | specs = glob.glob(spec_path + '/*.stone') # Arbitrary sorting 15 | specs.sort() 16 | 17 | repo_path = os.path.abspath('dropbox-sdk-dotnet') 18 | print('Generating Stone types') 19 | try: 20 | shutil.rmtree(os.path.join(repo_path, 'Dropbox.Api', 'Generated')) 21 | except OSError: 22 | pass 23 | try: 24 | subprocess.check_output( 25 | (['python', '-m', 'stone.cli', '--filter-by-route-attr', 'alpah_group=null', '-a:all', generator_path + '/csharp.stoneg.py'] + 26 | [os.path.join(repo_path, 'Dropbox.Api')] + specs)) 27 | except subprocess.CalledProcessError as e: 28 | print(e.output) 29 | 30 | if __name__ == '__main__': 31 | main() 32 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/README.md: -------------------------------------------------------------------------------- 1 | # Simple Blog Demo 2 | 3 | An example web app built using Dropbox API v2 .NET SDK. This app allows you to post blogs which will be automatically saved to your Dropbox. It can help you go through the server app OAuth flow and file operations APIs. 4 | 5 | ## Setup 6 | 7 | To run this web app, load Dropbox.Api.sln in Visual Studio and set SimpleBlogDemo as startup project. 8 | 9 | In appSettings section of Web.config, set DropboxAppKey and DropboxAppSecret to be your app key and secret. You can find them from the App Console at https://www.dropbox.com/developers/apps 10 | 11 | Add http://localhost:5000/Home/Auth to the redirect URL list in the app console. 12 | 13 | ## Run 14 | 15 | In Visual Studio, launch the web app in your desired browser. You can sign up for a test account by clicking the sign up button (make sure you put a blog name here, it will link to article creation page). 16 | 17 | After registration, you can click the connect button which will kick out the OAuth flow. Once connected, all articles you create will be saved under /{Your Dropbox App Name} folder. 18 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model List 2 | @{ 3 | ViewBag.Title = "Home"; 4 | } 5 | 6 |
7 |

Welcome to the Simple Blog Demo

8 |

9 | This is a sample application that demonstrates how to use the Dropbox 10 | .Net SDK to build a simple blog. 11 |

12 | 13 | @Html.ActionLink( 14 | linkText: "Sign up now!", 15 | actionName: "Register", 16 | routeValues: new {}, 17 | htmlAttributes: new { @class = "btn btn-lg btn-primary" }) 18 |
19 | 20 |
21 | @foreach (var blog in Model) 22 | { 23 |
24 |

@blog.BlogName

25 |
    26 | @foreach (var article in blog.BlogArticles.Reverse().Take(5)) 27 | { 28 |
  • @article.Name
  • 29 | } 30 |
31 |
32 | } 33 |
34 | 35 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Shared/UniversalDemo.Shared.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6bcc4215-b726-4b37-a932-4dca74a1d465 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/README.md: -------------------------------------------------------------------------------- 1 | # Simple Business Dashboard 2 | 3 | A example web app built using Dropbox API v2 .NET SDK. This app allow you to post blogs which will be automatically saved to your Dropbox. It can help you go througth the server app OAuth flow and file operations APIs. 4 | 5 | ## Setup 6 | 7 | To run this web app, load Dropbox.Api.sln in Visual Studio and set SimpleBusinessDashboard as startup project. 8 | 9 | In appSettings section of Web.config, set DropboxAppKey and DropboxAppSecret to be your app key and secret. You can find them from the App Console at https://www.dropbox.com/developers/apps 10 | 11 | Add http://localhost:5001/Home/Auth to the redirect URL list in the app console. 12 | 13 | ## Run 14 | 15 | In Visual Studio, launch the web app in your desired browser. You can sign up for a test account by clicking the sign up button (make sure you put a blog name here, it will link to article creation page). 16 | 17 | After registration, you can click the connect button which will kick out the OAuth flow. Once connected, all articles you create will be saved under /{Your Dropbox App Name} folder. 18 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Helpers/MaybeRequireHttps.cs: -------------------------------------------------------------------------------- 1 | namespace SimpleBlogDemo.Helpers 2 | { 3 | using System; 4 | using System.Web.Configuration; 5 | using System.Web.Mvc; 6 | 7 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, 8 | AllowMultiple = false)] 9 | public class RequireHttpsOrXForwardedAttribute : RequireHttpsAttribute 10 | { 11 | private string Environment = WebConfigurationManager.AppSettings["Environment"]; 12 | 13 | public override void OnAuthorization(AuthorizationContext filterContext) 14 | { 15 | if (filterContext == null) 16 | { 17 | throw new ArgumentNullException("filterContext"); 18 | } 19 | 20 | if (filterContext.HttpContext.Request.IsSecureConnection) 21 | { 22 | return; 23 | } 24 | 25 | if (string.Equals(filterContext.HttpContext.Request.Headers["X-Forwarded-Proto"], 26 | "https", 27 | StringComparison.InvariantCultureIgnoreCase)) 28 | { 29 | return; 30 | } 31 | 32 | if (filterContext.HttpContext.Request.IsLocal) 33 | { 34 | return; 35 | } 36 | 37 | HandleNonHttpsRequest(filterContext); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Dropbox Inc., http://www.dropbox.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests/Dropbox.Api.Unit.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | false 6 | 7 | false 8 | 9 | ../stylecop.ruleset 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | runtime; build; native; contentfiles; analyzers; buildtransitive 22 | all 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Helpers/ModelHelpers.cs: -------------------------------------------------------------------------------- 1 | using Dropbox.Api; 2 | using SimpleBlogDemo.Models; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Web; 7 | using WebMatrix.WebData; 8 | 9 | namespace SimpleBlogDemo.Helpers 10 | { 11 | public static class ModelHelpers 12 | { 13 | public static UserProfile CurrentUser(this UsersStore store) 14 | { 15 | if (!WebSecurity.IsAuthenticated) 16 | { 17 | return null; 18 | } 19 | 20 | var users = from u in store.Users 21 | where u.ID == WebSecurity.CurrentUserId 22 | select u; 23 | return users.Single(); 24 | } 25 | 26 | public static DropboxClient GetAuthenticatedClient(this UserProfile user) 27 | { 28 | if (!WebSecurity.IsAuthenticated || 29 | user.ID != WebSecurity.CurrentUserId || 30 | string.IsNullOrWhiteSpace(user.DropboxAccessToken)) 31 | { 32 | return null; 33 | } 34 | 35 | return new DropboxClient(user.DropboxAccessToken, new DropboxClientConfig("SimpleBlogDemo")); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewBag.Title - Simple Blog Demo 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | 10 | 11 | 23 | 24 |
25 | @Html.RenderFlash() 26 | @RenderBody() 27 |
28 | 29 | @Scripts.Render("~/bundles/jquery") 30 | @Scripts.Render("~/bundles/bootstrap") 31 | @Scripts.Render("~/bundles/graph") 32 | @RenderSection("scripts", required: false) 33 | 34 | 35 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests/StoneTests.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Dropbox Inc. All rights reserved. 4 | // 5 | //----------------------------------------------------------------------------- 6 | 7 | namespace Dropbox.Api.Unit.Tests 8 | { 9 | using System; 10 | using Dropbox.Api.Files; 11 | using Dropbox.Api.Stone; 12 | using Microsoft.VisualStudio.TestTools.UnitTesting; 13 | 14 | /// 15 | /// Tests related to stone serialization. 16 | /// 17 | [TestClass] 18 | public class StoneTests 19 | { 20 | /// 21 | /// Smoke test for nested unions. 22 | /// 23 | [TestMethod] 24 | public void TestNestedUnion() 25 | { 26 | var result = JsonWriter.Write( 27 | new GetMetadataError.Path(LookupError.NotFound.Instance), 28 | GetMetadataError.Encoder); 29 | 30 | var obj = JsonReader.Read(result, GetMetadataError.Decoder); 31 | 32 | Assert.IsTrue(obj.IsPath); 33 | Assert.IsTrue(obj.AsPath.Value.IsNotFound); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/ApiException.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Dropbox Inc. All rights reserved. 4 | // 5 | //----------------------------------------------------------------------------- 6 | 7 | namespace Dropbox.Api 8 | { 9 | using System; 10 | 11 | using Dropbox.Api.Stone; 12 | 13 | /// 14 | /// The exception type that will be raised by an 15 | /// implementation if there is an error processing the request which is caused by 16 | /// failure in API route. 17 | /// 18 | /// The type of the error. 19 | public sealed class ApiException : StructuredException 20 | { 21 | /// 22 | /// Initializes a new instance of the class. 23 | /// 24 | /// The Dropbox request id. 25 | /// This constructor is only used when decoded from JSON. 26 | internal ApiException(string requestId) 27 | : base(requestId) 28 | { 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Scripts/sb-admin-2.js: -------------------------------------------------------------------------------- 1 | //Loads the correct sidebar on window load, 2 | //collapses the sidebar on window resize. 3 | // Sets the min-height of #page-wrapper to window size 4 | $(function() { 5 | $(window).bind("load resize", function() { 6 | topOffset = 50; 7 | width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width; 8 | if (width < 768) { 9 | $('div.navbar-collapse').addClass('collapse'); 10 | topOffset = 100; // 2-row-menu 11 | } else { 12 | $('div.navbar-collapse').removeClass('collapse'); 13 | } 14 | 15 | height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1; 16 | height = height - topOffset; 17 | if (height < 1) height = 1; 18 | if (height > topOffset) { 19 | $("#page-wrapper").css("min-height", (height) + "px"); 20 | } 21 | }); 22 | 23 | var url = window.location; 24 | var element = $('ul.nav a').filter(function() { 25 | return this.href == url || url.href.indexOf(this.href) == 0; 26 | }).addClass('active').parent().parent().addClass('in').parent(); 27 | if (element.is('li')) { 28 | element.addClass('active'); 29 | } 30 | }); 31 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Views/Blogs/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model Tuple, string, bool> 2 | 3 | @{ 4 | var list = Model.Item1; 5 | list.Reverse(); 6 | var blogname = Model.Item2; 7 | var isEditable = Model.Item3; 8 | 9 | ViewBag.Title = blogname + " Articles"; 10 | } 11 | 12 |
13 |

Articles

14 |
15 | 16 |
17 |
18 | Name 19 |
20 |
21 | Date 22 |
23 |
24 | 25 | @foreach (var curr in list) 26 | { 27 |
28 |
29 | @curr.Name 30 | @if (isEditable) 31 | { 32 | [edit] 33 | } 34 |
35 |
36 | @curr.Date.ToShortDateString() 37 |
38 |
39 | } 40 | 41 | @if (isEditable) 42 | { 43 |
44 |
45 | New Article 46 | [add] 47 |
48 |
49 | } 50 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Dropbox.Api.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | true 6 | 7 | ../stylecop.ruleset 8 | 9 | Dropbox.Api 10 | Official Dropbox .Net v2 SDK 11 | Dropbox Inc. 12 | Dropbox.Api 13 | Copyright © 2020 Dropbox Inc 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | runtime; build; native; contentfiles; analyzers; buildtransitive 23 | all 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Configuration; 7 | using System.Web.Mvc; 8 | using System.Web.Optimization; 9 | using System.Web.Routing; 10 | using System.Web.Script.Serialization; 11 | 12 | namespace SimpleBusinessDashboard 13 | { 14 | public class MvcApplication : System.Web.HttpApplication 15 | { 16 | public static string AppKey { get; private set; } 17 | 18 | public static string AppSecret { get; private set; } 19 | 20 | public static string AccessToken { get; set; } 21 | 22 | protected void Application_Start() 23 | { 24 | InitializeAppKeyAndSecret(); 25 | 26 | AreaRegistration.RegisterAllAreas(); 27 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 28 | RouteConfig.RegisterRoutes(RouteTable.Routes); 29 | BundleConfig.RegisterBundles(BundleTable.Bundles); 30 | } 31 | 32 | private void InitializeAppKeyAndSecret() 33 | { 34 | AppKey = WebConfigurationManager.AppSettings["DropboxAppKey"]; 35 | AppSecret = WebConfigurationManager.AppSettings["DropboxAppSecret"]; 36 | AccessToken = ""; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Override the default bootstrap behavior where horizontal description lists 13 | will truncate terms that are too long to fit in the left column 14 | */ 15 | .dl-horizontal dt { 16 | white-space: normal; 17 | } 18 | 19 | /* 20 | Set width on the form input elements since they're 100% wide by default` 21 | input, 22 | select, 23 | textarea { 24 | max-width: 280px; 25 | } 26 | */ 27 | 28 | /* highlight a block */ 29 | .highlight { 30 | background-color: #f7f7f9; 31 | border: 1px solid #e1e1e8; 32 | border-radius: 4px; 33 | margin-bottom: 14px; 34 | } 35 | 36 | .margin-top-10 { 37 | margin-top: 10px; 38 | } 39 | 40 | .margin-top-20 { 41 | margin-top: 20px; 42 | } 43 | 44 | .glyphicon-refresh-animate { 45 | -animation: spin .7s infinite linear; 46 | -webkit-animation: spin2 .7s infinite linear; 47 | } 48 | 49 | @-webkit-keyframes spin2 { 50 | from { -webkit-transform: rotate(0deg);} 51 | to { -webkit-transform: rotate(360deg);} 52 | } 53 | 54 | @keyframes spin { 55 | from { transform: scale(1) rotate(0deg);} 56 | to { transform: scale(1) rotate(360deg);} 57 | } -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace SimpleBlogDemo 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js", 24 | "~/Scripts/respond.js")); 25 | 26 | bundles.Add(new StyleBundle("~/Content/css").Include( 27 | "~/Content/bootstrap.css", 28 | "~/Content/site.css")); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewBag.Title - Simple Blog Demo 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | 10 | 11 | 26 |
27 | @Html.RenderFlash() 28 | @RenderBody() 29 |
30 | 31 | @Scripts.Render("~/bundles/jquery") 32 | @Scripts.Render("~/bundles/bootstrap") 33 | @RenderSection("scripts", required: false) 34 | 35 | 36 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/OAuthPKCE/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/OauthBasic/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleTest/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/DropboxTeamClient.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api 6 | { 7 | using sys = System; 8 | 9 | using Dropbox.Api.Stone; 10 | using Dropbox.Api.FileProperties.Routes; 11 | using Dropbox.Api.Team.Routes; 12 | using Dropbox.Api.TeamLog.Routes; 13 | 14 | public sealed partial class DropboxTeamClient 15 | { 16 | /// 17 | /// Gets the FileProperties routes. 18 | /// 19 | public FilePropertiesTeamRoutes FileProperties { get; private set; } 20 | 21 | /// 22 | /// Gets the Team routes. 23 | /// 24 | public TeamTeamRoutes Team { get; private set; } 25 | 26 | /// 27 | /// Gets the TeamLog routes. 28 | /// 29 | public TeamLogTeamRoutes TeamLog { get; private set; } 30 | 31 | /// 32 | /// Initializes the routes. 33 | /// 34 | /// The transport. 35 | internal override void InitializeRoutes(ITransport transport) 36 | { 37 | this.FileProperties = new FilePropertiesTeamRoutes(transport); 38 | this.Team = new TeamTeamRoutes(transport); 39 | this.TeamLog = new TeamLogTeamRoutes(transport); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 20 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Views/Blogs/Display.cshtml: -------------------------------------------------------------------------------- 1 | @model Tuple, string, bool> 2 | 3 | @{ 4 | var article = Model.Item1; 5 | var list = Model.Item2; 6 | var blogname = Model.Item3; 7 | var isEditable = Model.Item4; 8 | 9 | ViewBag.Title = article != null ? article.Metadata.Name : "Articles"; 10 | } 11 | 12 | @article.Content 13 | 14 |
15 | @for (var i = 0; i < list.Count; i++) 16 | { 17 | var curr = list[i]; 18 | if (curr.DisplayName == article.Metadata.DisplayName) 19 | { 20 |
21 | @if (i > 0) 22 | { 23 | « @list[i-1].Name 24 | } 25 |
26 |
27 | | 28 | all 29 | | 30 | @if (isEditable) 31 | { 32 | @Html.ActionLink("edit", article.Metadata.DisplayName, "Edit") 33 | @:| 34 | } 35 |
36 |
37 | @if (i + 1 < list.Count) 38 | { 39 | @list[i+1].Name » 40 | } 41 |
42 | break; 43 | } 44 | } 45 |
46 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 20 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Shared/UniversalDemo.Shared.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 6bcc4215-b726-4b37-a932-4dca74a1d465 7 | 8 | 9 | UniversalDemo 10 | 11 | 12 | 13 | Designer 14 | 15 | 16 | App.xaml 17 | 18 | 19 | 20 | False 21 | False 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SimpleBlogDemo")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SimpleBlogDemo")] 13 | [assembly: AssemblyCopyright("Copyright © Dropbox Inc")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("850120d5-99dd-4759-95ee-8d89038eafd5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SimpleBusinessDashboard")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SimpleBusinessDashboard")] 13 | [assembly: AssemblyCopyright("Copyright © Dropbox Inc")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("850120d5-99dd-4759-95ee-8d89038eafd5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/OAuthPKCE/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("OAuthTest")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("OAuthTest")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d379c634-a147-425a-94bb-ff73c54a9aa3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/OauthBasic/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("OAuthTest")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("OAuthTest")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d379c634-a147-425a-94bb-ff73c54a9aa3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleTest/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SimpleTest")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SimpleTest")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d379c634-a147-425a-94bb-ff73c54a9aa3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Dropbox.Api.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dropbox.Api 5 | Dropbox v2 API 6 | Dropbox 7 | Dropbox 8 | MIT 9 | https://www.dropbox.com/developers 10 | images\icon.png 11 | false 12 | The offical Dropbox SDK for DotNet. 13 | 14 | See https://github.com/dropbox/dropbox-sdk-dotnet/releases for notes on the current release. 15 | 16 | Copyright (c) 2020 Dropbox Inc., http://www.dropbox.com/ 17 | Dropbox Api 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UniversalDemo.Windows 6 | Paul 7 | Assets\StoreLogo.png 8 | 9 | 10 | 6.3.0 11 | 6.3.0 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Views/Home/SignIn.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | ViewBag.Title = "Sign In"; 4 | } 5 | 6 |
7 |
8 |

Sign In

9 | 10 |
11 | @using (Html.BeginForm("SignIn", "Home", FormMethod.Post)) 12 | { 13 | @Html.AntiForgeryToken() 14 | @Html.Hidden("returnUrl", (string)ViewBag.ReturnUrl); 15 | 16 |
17 | @Html.Label("Username", htmlAttributes: new { @class = "control-label", @for = "username" }) 18 | @Html.TextBox("username", null, htmlAttributes: new { @class = "form-control", placeholder = "username (email)" }) 19 |
20 | 21 |
22 | @Html.Label("Password", htmlAttributes: new { @class = "control-label", @for = "password" }) 23 | @Html.Password("password", null, htmlAttributes: new { @class = "form-control" }) 24 |
25 | 26 |
27 | 32 |
33 | 34 |
35 | 36 |
37 | } 38 |
39 |
40 |
41 | 42 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/DropboxAppClient.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api 6 | { 7 | using sys = System; 8 | 9 | using Dropbox.Api.Stone; 10 | using Dropbox.Api.Auth.Routes; 11 | using Dropbox.Api.Check.Routes; 12 | using Dropbox.Api.Files.Routes; 13 | using Dropbox.Api.Sharing.Routes; 14 | 15 | public sealed partial class DropboxAppClient 16 | { 17 | /// 18 | /// Gets the Auth routes. 19 | /// 20 | public AuthAppRoutes Auth { get; private set; } 21 | 22 | /// 23 | /// Gets the Check routes. 24 | /// 25 | public CheckAppRoutes Check { get; private set; } 26 | 27 | /// 28 | /// Gets the Files routes. 29 | /// 30 | public FilesAppRoutes Files { get; private set; } 31 | 32 | /// 33 | /// Gets the Sharing routes. 34 | /// 35 | public SharingAppRoutes Sharing { get; private set; } 36 | 37 | /// 38 | /// Initializes the routes. 39 | /// 40 | /// The transport. 41 | internal override void InitializeRoutes(ITransport transport) 42 | { 43 | this.Auth = new AuthAppRoutes(transport); 44 | this.Check = new CheckAppRoutes(transport); 45 | this.Files = new FilesAppRoutes(transport); 46 | this.Sharing = new SharingAppRoutes(transport); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/DropboxSettings.xaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | You are currently connected to Dropbox as Joe User. 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests/Dropbox.Api.Integration.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | false 6 | 7 | false 8 | 9 | ../stylecop.ruleset 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | runtime; build; native; contentfiles; analyzers; buildtransitive 25 | all 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | PreserveNewest 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Dropbox Inc. All rights reserved. 3 | // 4 | 5 | using System.Reflection; 6 | using System.Runtime.CompilerServices; 7 | using System.Runtime.InteropServices; 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("Dropbox.Api.Tests")] 13 | [assembly: AssemblyDescription("")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("Dropbox.Api.Tests")] 17 | [assembly: AssemblyCopyright("Copyright © 2016")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // Setting ComVisible to false makes the types in this assembly not visible 22 | // to COM components. If you need to access a type in this assembly from 23 | // COM, set the ComVisible attribute to true on that type. 24 | [assembly: ComVisible(false)] 25 | 26 | // The following GUID is for the ID of the typelib if this project is exposed to COM 27 | [assembly: Guid("5193572e-17f4-46b6-9a5b-e2bb316e408d")] 28 | 29 | // Version information for an assembly consists of the following four values: 30 | // 31 | // Major Version 32 | // Minor Version 33 | // Build Number 34 | // Revision 35 | // 36 | // You can specify all the values or you can default the Build and Revision Numbers 37 | // by using the '*' as shown below: 38 | // [assembly: AssemblyVersion("1.0.*")] 39 | [assembly: AssemblyVersion("1.0.0.0")] 40 | [assembly: AssemblyFileVersion("1.0.0.0")] 41 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Views/Home/Register.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | ViewBag.Title = "Register"; 4 | } 5 | 6 |

Register

7 | 8 |
9 | @using (Html.BeginForm(actionName: "Register", controllerName: "Home", method:FormMethod.Post)) 10 | { 11 | @Html.AntiForgeryToken(); 12 | 13 |
14 | @Html.Label("Username", htmlAttributes: new { @class = "control-label", @for = "username" }) 15 | @Html.TextBox("username", null, htmlAttributes: new { @class = "form-control", placeholder="username (email)" }) 16 |
17 | 18 |
19 | @Html.Label("Password", htmlAttributes: new { @class = "control-label", @for = "password1" }) 20 | @Html.Password("password1", null, htmlAttributes: new { @class = "form-control" }) 21 |
22 | 23 |
24 | @Html.Label("Repeat Password", htmlAttributes: new { @class = "control-label", @for = "password2" }) 25 | @Html.Password("password2", null, htmlAttributes: new { @class = "form-control" }) 26 |
27 | 28 |
29 | @Html.Label("Blog Name (optional)", htmlAttributes: new { @class = "control-label", @for = "blogname" }) 30 | @Html.TextBox("blogname", null, htmlAttributes: new { @class = "form-control" }) 31 |
32 | 33 |
34 | 38 |
39 | 40 |
41 | 42 |
43 | } 44 |
-------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace SimpleBlogDemo 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Blogs", 18 | url: "Blogs/{blogname}/{id}", 19 | defaults: new { controller = "Blogs", action = "Display", id = UrlParameter.Optional } 20 | ); 21 | routes.MapRoute( 22 | name: "Edit", 23 | url: "Edit/{id}", 24 | defaults: new { controller = "Edit", action = "Index" } 25 | ); 26 | routes.MapRoute( 27 | name: "Add", 28 | url: "Add", 29 | defaults: new { controller = "Edit", action = "Add" } 30 | ); 31 | routes.MapRoute( 32 | name: "Preview", 33 | url: "Preview", 34 | defaults: new { controller = "Edit", action = "Preview" } 35 | ); 36 | routes.MapRoute( 37 | name: "Article", 38 | url: "Article/{id}", 39 | defaults: new { controller = "Article", action = "Display" } 40 | ); 41 | routes.MapRoute( 42 | name: "Default", 43 | url: "{controller}/{action}/{id}", 44 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 45 | ); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UniversalDemo.WindowsPhone 7 | Paul 8 | Assets\StoreLogo.png 9 | 10 | 11 | 6.3.1 12 | 6.3.1 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace SimpleBusinessDashboard 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js")); 24 | 25 | bundles.Add(new ScriptBundle("~/bundles/graph").Include( 26 | "~/Scripts/raphael-min.js", 27 | "~/Scripts/morris.min.js", 28 | "~/Scripts/morris-data.js", 29 | "~/Scripts/sb-admin-2.js", 30 | "~/Scripts/morris.js", 31 | "~/Scripts/sb-admin-2.js")); 32 | 33 | bundles.Add(new StyleBundle("~/Content/css").Include( 34 | "~/Content/bootstrap.css", 35 | "~/Content/Site.css", 36 | "~/Content/sb-admin-2.css", 37 | "~/Content/morris.css")); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Views/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Views/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace UniversalDemo 2 | { 3 | using System; 4 | using Windows.UI.Xaml; 5 | using Windows.UI.Xaml.Controls; 6 | using Windows.UI.Xaml.Input; 7 | using Windows.UI.Xaml.Media; 8 | 9 | /// 10 | /// The main application page. 11 | /// 12 | public sealed partial class MainPage : Page 13 | { 14 | /// 15 | /// The swipe manager, this manages the swipe manipulation. 16 | /// 17 | private SwipeManager swipeManager; 18 | 19 | /// 20 | /// Initializes a new instance of the class. 21 | /// 22 | public MainPage() 23 | { 24 | this.InitializeComponent(); 25 | 26 | var imageSet = new ViewModel.AppImageSet(); 27 | this.DataContext = imageSet; 28 | this.swipeManager = new SwipeManager(this.ImageHolder, imageSet); 29 | 30 | this.Loaded += this.OnLoaded; 31 | this.SizeChanged += this.OnLoaded; 32 | } 33 | 34 | 35 | /// 36 | /// Called when the app is loaded or when the size changes, this keeps the 37 | /// previous and next images off screen. 38 | /// 39 | /// The sender. 40 | /// The instance containing the event data. 41 | private void OnLoaded(object sender, RoutedEventArgs e) 42 | { 43 | var nextTransform = (TranslateTransform)this.NextHolder.RenderTransform; 44 | nextTransform.X = this.RootGrid.ActualWidth; 45 | 46 | var prevTransform = (TranslateTransform)this.PrevHolder.RenderTransform; 47 | prevTransform.X = -this.RootGrid.ActualWidth; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Shared/ViewModel/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | namespace UniversalDemo.ViewModel 2 | { 3 | using System; 4 | using System.ComponentModel; 5 | using System.Threading.Tasks; 6 | using Windows.UI.Core; 7 | using Windows.UI.Xaml; 8 | 9 | /// 10 | /// Base class for view model objects. 11 | /// 12 | public class ViewModelBase : DependencyObject, INotifyPropertyChanged 13 | { 14 | /// 15 | /// Occurs when the value of a property has changed. 16 | /// 17 | public event PropertyChangedEventHandler PropertyChanged; 18 | 19 | /// 20 | /// Gets the application instance. 21 | /// 22 | public App App 23 | { 24 | get 25 | { 26 | return (App)Application.Current; 27 | } 28 | } 29 | 30 | /// 31 | /// Invokes an action on the UI thread asynchronously. 32 | /// 33 | /// The action to invoke. 34 | /// An asynchronous task. 35 | protected async Task InvokeAsync(DispatchedHandler action) 36 | { 37 | await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, action); 38 | } 39 | 40 | /// 41 | /// Notifies observers that a property value has changed. 42 | /// 43 | /// Name of the property that has changed, if this 44 | /// is the empty string, then all properties are assumed to have changed. 45 | protected void NotifyPropertyChanged(string propName = "") 46 | { 47 | var handler = this.PropertyChanged; 48 | if (handler != null) 49 | { 50 | handler(this, new PropertyChangedEventArgs(propName)); 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/DropboxClientBase.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Dropbox Inc. All rights reserved. 4 | // 5 | //----------------------------------------------------------------------------- 6 | 7 | namespace Dropbox.Api 8 | { 9 | using System; 10 | using Dropbox.Api.Stone; 11 | 12 | /// 13 | /// The base class for all Dropbox clients. 14 | /// 15 | public abstract class DropboxClientBase : IDisposable 16 | { 17 | /// 18 | /// The transport. 19 | /// 20 | private readonly ITransport transport; 21 | 22 | /// 23 | /// Initializes a new instance of the class. 24 | /// 25 | /// The transport. 26 | internal DropboxClientBase(ITransport transport) 27 | { 28 | this.transport = transport; 29 | this.InitializeRoutes(this.transport); 30 | } 31 | 32 | /// 33 | /// The public dispose. 34 | /// 35 | public void Dispose() 36 | { 37 | this.Dispose(true); 38 | GC.SuppressFinalize(this); 39 | } 40 | 41 | /// 42 | /// Initializes routes. 43 | /// 44 | /// The transport. 45 | internal abstract void InitializeRoutes(ITransport transport); 46 | 47 | /// 48 | /// The actual disposing logic. 49 | /// 50 | /// If is disposing. 51 | protected virtual void Dispose(bool disposing) 52 | { 53 | if (disposing) 54 | { 55 | // ITransport is safe for multiple disposal. 56 | this.transport.Dispose(); 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleTest/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34014 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SimpleTest { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("")] 29 | public string AccessToken { 30 | get { 31 | return ((string)(this["AccessToken"])); 32 | } 33 | set { 34 | this["AccessToken"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("")] 41 | public string Uid { 42 | get { 43 | return ((string)(this["Uid"])); 44 | } 45 | set { 46 | this["Uid"] = value; 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Views/Edit/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model Tuple 2 | 3 | @{ 4 | var markdown = Model.Item1; 5 | var metadata = Model.Item2; 6 | 7 | ViewBag.Title = string.Format("Editing \"{0}\"", metadata.Name); 8 | } 9 | 10 |

Editing “@metadata.Name”

11 | 12 | @using (Html.BeginForm("Index", "Edit", FormMethod.Post)) 13 | { 14 | @Html.AntiForgeryToken() 15 | @Html.Hidden("filename", metadata.Filename) 16 | @Html.Hidden("rev", metadata.Rev) 17 | 18 |
19 | @Html.Label("Date", new { @class = "control-label" }) 20 |
21 | @metadata.Date.ToShortDateString() 22 |
23 |
24 | 25 |
26 | @Html.Label("Content", new { @class = "control-label", @for = "content" }) 27 | @Html.TextArea("content", markdown, new { @class = "form-control", rows=20 }) 28 |
29 | 30 |
31 | 32 | 33 |
34 | } 35 | 36 | 55 | 56 | @section scripts 57 | { 58 | 59 | } 60 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api.Integration.Tests/MockHttpMessageHandler.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Dropbox Inc. All rights reserved. 4 | // 5 | //----------------------------------------------------------------------------- 6 | 7 | namespace Dropbox.Api.Tests 8 | { 9 | using System; 10 | using System.Net.Http; 11 | using System.Threading; 12 | using System.Threading.Tasks; 13 | 14 | /// 15 | /// A mock HTTP handler for use with integration tests. 16 | /// 17 | public class MockHttpMessageHandler : HttpClientHandler 18 | { 19 | /// 20 | /// The mock handler. 21 | /// 22 | private readonly Func> handler; 23 | 24 | /// 25 | /// Initializes a new instance of the class. 26 | /// 27 | /// The mock response. 28 | /// The mock handler. 29 | public MockHttpMessageHandler(Func> handler) 30 | { 31 | this.handler = handler; 32 | } 33 | 34 | /// 35 | /// HTTP sender alias. 36 | /// 37 | /// The request message. 38 | /// A for fetching a . 39 | public delegate Task Sender(HttpRequestMessage message); 40 | 41 | /// 42 | /// The send async override. 43 | /// 44 | /// The request. 45 | /// The cancellation token. 46 | /// The response. 47 | protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) 48 | { 49 | return this.handler(request, r => base.SendAsync(r, cancellationToken)); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | 35 | This application is not currently connected to Dropbox 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.WindowsPhone/SettingsDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace UniversalDemo 2 | { 3 | using System; 4 | using System.Threading.Tasks; 5 | using Windows.UI.Xaml; 6 | using Windows.UI.Xaml.Controls; 7 | 8 | /// 9 | /// This dialog manages the Dropbox connection and presents UI to allow the user 10 | /// to choose to connect or disconnect 11 | /// 12 | public sealed partial class SettingsDialog : ContentDialog 13 | { 14 | /// 15 | /// The application instance. 16 | /// 17 | private App app = (App)Application.Current; 18 | 19 | /// 20 | /// Initializes a new instance of the class. 21 | /// 22 | public SettingsDialog() 23 | { 24 | this.InitializeComponent(); 25 | var task = this.CheckConnection(); 26 | } 27 | 28 | /// 29 | /// Checks the if the app is currently connected and sets the UI to reflect 30 | /// the connection state. 31 | /// 32 | /// An asynchronous task. 33 | private async Task CheckConnection() 34 | { 35 | if (string.IsNullOrEmpty(this.app.AccessToken)) 36 | { 37 | this.SetDisconnected(); 38 | } 39 | else 40 | { 41 | await this.SetConnected(); 42 | } 43 | } 44 | 45 | /// 46 | /// Sets the UI to reflect that the app is currently. 47 | /// 48 | /// An asynchronous task. 49 | private async Task SetConnected() 50 | { 51 | this.PrimaryButtonText = "disconnect"; 52 | var client = this.app.DropboxClient; 53 | var account = await client.Users.GetCurrentAccountAsync(); 54 | 55 | this.ConnectText.Text = string.Format( 56 | "You are currently connected to Dropbox as {0}", 57 | account.Name.DisplayName); 58 | } 59 | 60 | /// 61 | /// Sets the UI state to reflect that the app is not connected. 62 | /// 63 | private void SetDisconnected() 64 | { 65 | this.PrimaryButtonText = "connect"; 66 | this.ConnectText.Text = "You are not currently connected to Dropbox."; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Shared/BoolToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | namespace UniversalDemo 2 | { 3 | using System; 4 | using Windows.UI.Xaml; 5 | using Windows.UI.Xaml.Data; 6 | 7 | /// 8 | /// Converts a value to a value. 9 | /// 10 | public class BoolToVisibilityConverter : IValueConverter 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | public BoolToVisibilityConverter() 16 | { 17 | this.DefaultValue = Visibility.Visible; 18 | } 19 | 20 | /// 21 | /// Gets or sets the default value when the value to be converted 22 | /// is not a . 23 | /// 24 | public Visibility DefaultValue { get; set; } 25 | 26 | /// Converts the specified value to a visibility. 27 | /// The value to convert. 28 | /// Type of the target. 29 | /// The parameter. 30 | /// The language. 31 | /// if value is true; 32 | /// if value is false; 33 | /// otherwise returns the value of . 34 | /// 35 | public object Convert(object value, Type targetType, object parameter, string language) 36 | { 37 | if (value is bool) 38 | { 39 | return ((bool)value) ? Visibility.Visible : Visibility.Collapsed; 40 | } 41 | 42 | return this.DefaultValue; 43 | } 44 | 45 | /// Back conversion is not supported. 46 | /// The value. 47 | /// Type of the target. 48 | /// The parameter. 49 | /// The language. 50 | /// Nothing is returned 51 | /// Back conversion is 52 | /// not supported. 53 | public object ConvertBack(object value, Type targetType, object parameter, string language) 54 | { 55 | throw new NotSupportedException(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/OAuthPKCE/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace OauthPKCE { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("")] 29 | public string RefreshToken { 30 | get { 31 | return ((string)(this["RefreshToken"])); 32 | } 33 | set { 34 | this["RefreshToken"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("")] 41 | public string AccessToken { 42 | get { 43 | return ((string)(this["AccessToken"])); 44 | } 45 | set { 46 | this["AccessToken"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("")] 53 | public string Uid { 54 | get { 55 | return ((string)(this["Uid"])); 56 | } 57 | set { 58 | this["Uid"] = value; 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/OauthBasic/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace OauthTest { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("")] 29 | public string RefreshToken { 30 | get { 31 | return ((string)(this["RefreshToken"])); 32 | } 33 | set { 34 | this["RefreshToken"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("")] 41 | public string AccessToken { 42 | get { 43 | return ((string)(this["AccessToken"])); 44 | } 45 | set { 46 | this["AccessToken"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("")] 53 | public string Uid { 54 | get { 55 | return ((string)(this["Uid"])); 56 | } 57 | set { 58 | this["Uid"] = value; 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Configuration; 7 | using System.Web.Mvc; 8 | using System.Web.Optimization; 9 | using System.Web.Routing; 10 | using System.Web.Script.Serialization; 11 | using WebMatrix.WebData; 12 | 13 | namespace SimpleBlogDemo 14 | { 15 | public class MvcApplication : System.Web.HttpApplication 16 | { 17 | public static string AppKey { get; private set; } 18 | 19 | public static string AppSecret { get; private set; } 20 | 21 | protected void Application_Start() 22 | { 23 | InitializeAppKeyAndSecret(); 24 | 25 | AreaRegistration.RegisterAllAreas(); 26 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 27 | RouteConfig.RegisterRoutes(RouteTable.Routes); 28 | BundleConfig.RegisterBundles(BundleTable.Bundles); 29 | 30 | var store = new SimpleBlogDemo.Models.UsersStore(); 31 | if (store.Users.Count() == 0) 32 | { 33 | store.Users.Add(new Models.UserProfile { UserName = "Admin" }); 34 | store.SaveChanges(); 35 | } 36 | 37 | WebSecurity.InitializeDatabaseConnection("UsersStore", "UserProfiles", "ID", "UserName", true); 38 | } 39 | 40 | private void InitializeAppKeyAndSecret() 41 | { 42 | var appKey = WebConfigurationManager.AppSettings["DropboxAppKey"]; 43 | var appSecret = WebConfigurationManager.AppSettings["DropboxAppSecret"]; 44 | 45 | if (string.IsNullOrWhiteSpace(appKey) || 46 | string.IsNullOrWhiteSpace(appSecret)) 47 | { 48 | var infoPath = HttpContext.Current.Server.MapPath("~/App_Data/DropboxInfo.json"); 49 | 50 | if (File.Exists(infoPath)) 51 | { 52 | string json; 53 | 54 | using (var stream = new FileStream(infoPath, FileMode.Open, FileAccess.Read)) 55 | { 56 | var reader = (TextReader)new StreamReader(stream); 57 | json = reader.ReadToEnd(); 58 | } 59 | var ser = new JavaScriptSerializer(); 60 | var info = ser.Deserialize>(json); 61 | 62 | appKey = info["AppKey"]; 63 | appSecret = info["AppSecret"]; 64 | } 65 | } 66 | 67 | AppKey = appKey; 68 | AppSecret = appSecret; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Helpers/FlashHelpers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web; 6 | using System.Web.Mvc; 7 | 8 | namespace SimpleBlogDemo.Helpers 9 | { 10 | public enum FlashLevel 11 | { 12 | Success, 13 | Info, 14 | Warning, 15 | Danger 16 | } 17 | 18 | public static class FlashHelpers 19 | { 20 | public static void Flash(this ControllerBase controller, string message, FlashLevel level = FlashLevel.Info) 21 | { 22 | object flashStackObject; 23 | List flashStack; 24 | 25 | if (!controller.TempData.TryGetValue("flash", out flashStackObject)) 26 | { 27 | flashStackObject = new List(); 28 | controller.TempData["flash"] = flashStackObject; 29 | } 30 | 31 | flashStack = flashStackObject as List; 32 | 33 | flashStack.Add(new FlashItem { 34 | Message = message, 35 | Level = level 36 | }); 37 | } 38 | 39 | public static HtmlString RenderFlash(this HtmlHelper html) 40 | { 41 | object flashStackObject; 42 | List flashStack; 43 | 44 | html.ViewContext.TempData.TryGetValue("flash", out flashStackObject); 45 | 46 | flashStack = flashStackObject as List; 47 | if (flashStack == null || flashStack.Count == 0) 48 | { 49 | return null; 50 | } 51 | 52 | var top = flashStack[0]; 53 | if (flashStack.Count > 1) 54 | { 55 | flashStack.RemoveAt(0); 56 | html.ViewContext.TempData["flash"] = flashStack; 57 | } 58 | 59 | var level = top.Level.ToString().ToLowerInvariant(); 60 | var message = HttpUtility.HtmlEncode(top.Message).Replace("\r", "").Replace("\n", "
\n").Replace("'", "@squo;"); 61 | 62 | var builder = new StringBuilder(); 63 | builder.AppendFormat("
", level).AppendLine(); 64 | builder.AppendLine(" ×"); 65 | builder.AppendLine(message); 66 | builder.AppendLine("
"); 67 | 68 | return new HtmlString(builder.ToString()); 69 | } 70 | 71 | class FlashItem 72 | { 73 | public string Message { get; set; } 74 | public FlashLevel Level { get; set; } 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /.github/workflows/spec_update.yml: -------------------------------------------------------------------------------- 1 | name: Spec Update 2 | on: 3 | workflow_dispatch: 4 | repository_dispatch: 5 | types: [spec_update] 6 | 7 | jobs: 8 | Update: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: Setup Python environment 13 | uses: actions/setup-python@v2.2.2 14 | with: 15 | python-version: 3.7 16 | - name: Get current time 17 | uses: 1466587594/get-current-time@v2 18 | id: current-time 19 | with: 20 | format: YYYY_MM_DD 21 | utcOffset: "-08:00" 22 | - name: Install Requirements 23 | run: | 24 | python -m pip install --upgrade pip 25 | pip install -r generator/requirements-dev.txt 26 | - name: Update Modules 27 | run: | 28 | git submodule init 29 | git submodule update --remote --recursive 30 | - name: Generate Branch Name 31 | id: git-branch 32 | run: | 33 | echo "::set-output name=branch::spec_update_${{ steps.current-time.outputs.formattedTime }}" 34 | - name: Generate Num Diffs 35 | id: git-diff-num 36 | run: | 37 | diffs=$(git diff --submodule spec | grep ">" | wc -l) 38 | echo "Number of Spec diffs: $diffs" 39 | echo "::set-output name=num-diff::$diffs" 40 | - name: Generate Diff 41 | id: git-diff 42 | run: | 43 | cd spec 44 | gitdiff=$(git log -n ${{ steps.git-diff-num.outputs.num-diff }} --pretty="format:%n %H %n%n %b") 45 | commit="Automated Spec Update $gitdiff" 46 | commit="${commit//'%'/'%25'}" 47 | commit="${commit//$'\n'/'%0A'}" 48 | commit="${commit//$'\r'/'%0D'}" 49 | echo "Commit Message: $commit" 50 | echo "::set-output name=commit::$commit" 51 | - name: Generate New Routes 52 | run: | 53 | python generator/generate_routes.py 54 | git add dropbox-sdk-dotnet/Dropbox.Api/Generated 55 | git add spec 56 | - name: Create Pull Request 57 | uses: peter-evans/create-pull-request@v3.8.2 58 | if: steps.git-diff-num.outputs.num-diff != 0 59 | with: 60 | token: ${{ secrets.SPEC_UPDATE_TOKEN }} 61 | commit-message: | 62 | ${{ steps.git-diff.outputs.commit}} 63 | branch: ${{ steps.git-branch.outputs.branch }} 64 | delete-branch: true 65 | title: 'Automated Spec Update' 66 | body: | 67 | ${{ steps.git-diff.outputs.commit}} 68 | base: 'main' 69 | team-reviewers: | 70 | owners 71 | maintainers 72 | draft: false 73 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Helpers/FlashHelpers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web; 6 | using System.Web.Mvc; 7 | 8 | namespace SimpleBusinessDashboard.Helpers 9 | { 10 | public enum FlashLevel 11 | { 12 | Success, 13 | Info, 14 | Warning, 15 | Danger 16 | } 17 | 18 | public static class FlashHelpers 19 | { 20 | public static void Flash(this ControllerBase controller, string message, FlashLevel level = FlashLevel.Info) 21 | { 22 | object flashStackObject; 23 | List flashStack; 24 | 25 | if (!controller.TempData.TryGetValue("flash", out flashStackObject)) 26 | { 27 | flashStackObject = new List(); 28 | controller.TempData["flash"] = flashStackObject; 29 | } 30 | 31 | flashStack = flashStackObject as List; 32 | 33 | flashStack.Add(new FlashItem { 34 | Message = message, 35 | Level = level 36 | }); 37 | } 38 | 39 | public static HtmlString RenderFlash(this HtmlHelper html) 40 | { 41 | object flashStackObject; 42 | List flashStack; 43 | 44 | html.ViewContext.TempData.TryGetValue("flash", out flashStackObject); 45 | 46 | flashStack = flashStackObject as List; 47 | if (flashStack == null || flashStack.Count == 0) 48 | { 49 | return null; 50 | } 51 | 52 | var top = flashStack[0]; 53 | if (flashStack.Count > 1) 54 | { 55 | flashStack.RemoveAt(0); 56 | html.ViewContext.TempData["flash"] = flashStack; 57 | } 58 | 59 | var level = top.Level.ToString().ToLowerInvariant(); 60 | var message = HttpUtility.HtmlEncode(top.Message).Replace("\r", "").Replace("\n", "
\n").Replace("'", "@squo;"); 61 | 62 | var builder = new StringBuilder(); 63 | builder.AppendFormat("
", level).AppendLine(); 64 | builder.AppendLine(" ×"); 65 | builder.AppendLine(message); 66 | builder.AppendLine("
"); 67 | 68 | return new HtmlString(builder.ToString()); 69 | } 70 | 71 | class FlashItem 72 | { 73 | public string Message { get; set; } 74 | public FlashLevel Level { get; set; } 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBusinessDashboard/Images/dropbox-logo.txt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 11 | 14 | 17 | 20 | 23 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Views/Edit/Add.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "New Article"; 3 | } 4 | 5 |
6 |
7 |

New Article

8 | 9 | @using (Html.BeginForm("Add", "Edit", FormMethod.Post, new { id = "add-form" })) 10 | { 11 | @Html.AntiForgeryToken() 12 | 13 |
14 | 15 | 16 |
17 | 18 |
19 | 20 | 21 |
22 | 23 |
24 | 25 | 26 |
27 | 28 |
29 | 30 | 31 |
32 | } 33 |
34 |
35 | 36 | 55 | 56 | @section scripts 57 | { 58 | @Scripts.Render("~/bundles/jqueryval") 59 | 60 | 80 | } 81 | 82 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/DropboxClientConfig.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Dropbox Inc. All rights reserved. 4 | // 5 | //----------------------------------------------------------------------------- 6 | 7 | namespace Dropbox.Api 8 | { 9 | using System.Net.Http; 10 | 11 | /// 12 | /// The class which contains all configurations for Dropbox client. 13 | /// 14 | public sealed class DropboxClientConfig 15 | { 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | public DropboxClientConfig() 20 | : this(null) 21 | { 22 | } 23 | 24 | /// 25 | /// Initializes a new instance of the class. 26 | /// 27 | /// The user agent to use when making requests. 28 | public DropboxClientConfig(string userAgent) 29 | : this(userAgent, 4) 30 | { 31 | } 32 | 33 | /// 34 | /// Initializes a new instance of the class. 35 | /// 36 | /// The user agent to use when making requests. 37 | /// The max number retries on error. 38 | public DropboxClientConfig(string userAgent, int maxRetriesOnError) 39 | { 40 | this.UserAgent = userAgent; 41 | this.MaxRetriesOnError = maxRetriesOnError; 42 | } 43 | 44 | /// 45 | /// Gets or sets the max number retries on error. Default value is 4. 46 | /// 47 | public int MaxRetriesOnError { get; set; } 48 | 49 | /// 50 | /// Gets or sets the user agent to use when making requests. 51 | /// 52 | /// 53 | /// This value helps Dropbox to identify requests coming from your application. 54 | /// We recommend that you use the format "AppName/Version"; if a value is supplied, the string 55 | /// "/OfficialDropboxDotNetV2SDK/__version__" is appended to the user agent. 56 | /// 57 | public string UserAgent { get; set; } 58 | 59 | /// 60 | /// Gets or sets the custom http client. If not set, a default http client will be created. 61 | /// 62 | public HttpClient HttpClient { get; set; } 63 | 64 | /// 65 | /// Gets or sets the custom http client for long poll request. If not set, a default 66 | /// http client with a longer timeout (480 seconds) will be created. 67 | /// 68 | public HttpClient LongPollHttpClient { get; set; } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/DropboxAppClient.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Dropbox Inc. All rights reserved. 4 | // 5 | //----------------------------------------------------------------------------- 6 | 7 | namespace Dropbox.Api 8 | { 9 | using System; 10 | using System.Text; 11 | 12 | /// 13 | /// The client which contains endpoints which perform app-auth actions. 14 | /// 15 | public sealed partial class DropboxAppClient : DropboxClientBase 16 | { 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | /// The Dropbox app key (e.g. consumer key in OAuth). 21 | /// The Dropbox app secret (e.g. consumer secret in OAuth). 22 | public DropboxAppClient(string appKey, string appSecret) 23 | : this(appKey, appSecret, new DropboxClientConfig()) 24 | { 25 | } 26 | 27 | /// 28 | /// Initializes a new instance of the class. 29 | /// 30 | /// The Dropbox app key (e.g. consumer key in OAuth). 31 | /// The Dropbox app secret (e.g. consumer secret in OAuth). 32 | /// The . 33 | public DropboxAppClient(string appKey, string appSecret, DropboxClientConfig config) 34 | : this(new DropboxRequestHandlerOptions(config, GetBasicAuthHeader(appKey, appSecret), null, null, null, null)) 35 | { 36 | } 37 | 38 | /// 39 | /// Initializes a new instance of the class. 40 | /// 41 | /// The request handler options. 42 | private DropboxAppClient(DropboxRequestHandlerOptions options) 43 | : base(new DropboxRequestHandler(options)) 44 | { 45 | } 46 | 47 | /// 48 | /// Gets the basic auth header from app key and app secret. 49 | /// 50 | /// The app key. 51 | /// The app secret. 52 | /// The basic auth header. 53 | private static string GetBasicAuthHeader(string appKey, string appSecret) 54 | { 55 | if (appKey == null) 56 | { 57 | throw new ArgumentNullException("appKey"); 58 | } 59 | 60 | if (appSecret == null) 61 | { 62 | throw new ArgumentNullException("appSecret"); 63 | } 64 | 65 | var rawValue = $"{appKey}:{appSecret}"; 66 | return Convert.ToBase64String(Encoding.UTF8.GetBytes(rawValue)); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /generator/generator.pyproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | 2.0 6 | {7a16f255-245f-4592-a39a-2d3524e06a27} 7 | 8 | run_this.py 9 | 10 | . 11 | . 12 | {888888a0-9f3d-457c-b088-3a5042f75d52} 13 | Standard Python launcher 14 | 15 | 16 | False 17 | 18 | 19 | 20 | 21 | 10.0 22 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets 23 | 24 | 25 | 26 | 27 | Code 28 | 29 | 30 | Code 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Controllers/BlogsController.cs: -------------------------------------------------------------------------------- 1 | using Dropbox.Api; 2 | using SimpleBlogDemo.Models; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Net.Http; 7 | using System.Web; 8 | using System.Web.Mvc; 9 | using SimpleBlogDemo.Helpers; 10 | using System.Threading.Tasks; 11 | using WebMatrix.WebData; 12 | 13 | namespace SimpleBlogDemo.Controllers 14 | { 15 | [RequireHttpsOrXForwarded] 16 | public partial class BlogsController : AsyncController 17 | { 18 | // GET: Blogs 19 | public async Task DisplayAsync(string blogname, string id = null) 20 | { 21 | var user = this.GetBlogUser(blogname); 22 | if (user == null) 23 | { 24 | return RedirectToAction("Index", "Home"); 25 | } 26 | 27 | using (var client = this.GetClient(user)) 28 | { 29 | if (client == null) 30 | { 31 | return RedirectToAction("Index", "Home"); 32 | } 33 | 34 | var articles = new List(await client.GetArticleList()); 35 | bool isEditable = WebSecurity.IsAuthenticated && WebSecurity.CurrentUserId == user.ID; 36 | 37 | Article article = null; 38 | 39 | if (!string.IsNullOrWhiteSpace(id)) 40 | { 41 | var filtered = from a in articles 42 | where a.DisplayName == id 43 | select a; 44 | var selected = filtered.FirstOrDefault(); 45 | if (selected != null) 46 | { 47 | article = await client.GetArticle(blogname, selected); 48 | } 49 | } 50 | 51 | if (article == null) 52 | { 53 | return View("Index", Tuple.Create(articles, blogname, isEditable)); 54 | } 55 | else 56 | { 57 | return View("Display", Tuple.Create(article, articles, blogname, isEditable)); 58 | } 59 | } 60 | } 61 | } 62 | 63 | public partial class BlogsController 64 | { 65 | private UsersStore store = new UsersStore(); 66 | 67 | private UserProfile GetBlogUser(string blogname) 68 | { 69 | if (string.IsNullOrWhiteSpace(blogname)) 70 | { 71 | return null; 72 | } 73 | 74 | var users = from u in store.Users 75 | where u.BlogName == blogname 76 | select u; 77 | 78 | return users.FirstOrDefault(); 79 | } 80 | 81 | private DropboxClient GetClient(UserProfile user) 82 | { 83 | if (user == null || string.IsNullOrWhiteSpace(user.DropboxAccessToken)) 84 | { 85 | return null; 86 | } 87 | 88 | return new DropboxClient(user.DropboxAccessToken, new DropboxClientConfig("SimpleBlogDemo")); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/Auth/AuthUserRoutes.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api.Auth.Routes 6 | { 7 | using sys = System; 8 | using io = System.IO; 9 | using col = System.Collections.Generic; 10 | using t = System.Threading.Tasks; 11 | using enc = Dropbox.Api.Stone; 12 | 13 | /// 14 | /// The routes for the namespace 15 | /// 16 | public class AuthUserRoutes 17 | { 18 | /// 19 | /// Initializes a new instance of the class. 20 | /// 21 | /// The transport to use 22 | internal AuthUserRoutes(enc.ITransport transport) 23 | { 24 | this.Transport = transport; 25 | } 26 | 27 | /// 28 | /// Gets the transport used for these routes 29 | /// 30 | internal enc.ITransport Transport { get; private set; } 31 | 32 | /// 33 | /// Disables the access token used to authenticate the call. If there is a 34 | /// corresponding refresh token for the access token, this disables that refresh token, 35 | /// as well as any other access tokens for that refresh token. 36 | /// 37 | /// The task that represents the asynchronous send operation. 38 | public t.Task TokenRevokeAsync() 39 | { 40 | return this.Transport.SendRpcRequestAsync(enc.Empty.Instance, "api", "/auth/token/revoke", "user", enc.EmptyEncoder.Instance, enc.EmptyDecoder.Instance, enc.EmptyDecoder.Instance); 41 | } 42 | 43 | /// 44 | /// Begins an asynchronous send to the token revoke route. 45 | /// 46 | /// The method to be called when the asynchronous send is 47 | /// completed. 48 | /// A user provided object that distinguished this send from other 49 | /// send requests. 50 | /// An object that represents the asynchronous send request. 51 | public sys.IAsyncResult BeginTokenRevoke(sys.AsyncCallback callback, object state = null) 52 | { 53 | var task = this.TokenRevokeAsync(); 54 | 55 | return enc.Util.ToApm(task, callback, state); 56 | } 57 | 58 | /// 59 | /// Waits for the pending asynchronous send to the token revoke route to 60 | /// complete 61 | /// 62 | /// The reference to the pending asynchronous send 63 | /// request 64 | public void EndTokenRevoke(sys.IAsyncResult asyncResult) 65 | { 66 | var task = asyncResult as t.Task; 67 | if (task == null) 68 | { 69 | throw new sys.InvalidOperationException(); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/Openid/UserInfoArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api.Openid 6 | { 7 | using sys = System; 8 | using col = System.Collections.Generic; 9 | using re = System.Text.RegularExpressions; 10 | 11 | using enc = Dropbox.Api.Stone; 12 | 13 | /// 14 | /// No Parameters 15 | /// 16 | public class UserInfoArgs 17 | { 18 | #pragma warning disable 108 19 | 20 | /// 21 | /// The encoder instance. 22 | /// 23 | internal static enc.StructEncoder Encoder = new UserInfoArgsEncoder(); 24 | 25 | /// 26 | /// The decoder instance. 27 | /// 28 | internal static enc.StructDecoder Decoder = new UserInfoArgsDecoder(); 29 | 30 | /// 31 | /// Initializes a new instance of the class. 32 | /// 33 | public UserInfoArgs() 34 | { 35 | } 36 | 37 | #region Encoder class 38 | 39 | /// 40 | /// Encoder for . 41 | /// 42 | private class UserInfoArgsEncoder : enc.StructEncoder 43 | { 44 | /// 45 | /// Encode fields of given value. 46 | /// 47 | /// The value. 48 | /// The writer. 49 | public override void EncodeFields(UserInfoArgs value, enc.IJsonWriter writer) 50 | { 51 | } 52 | } 53 | 54 | #endregion 55 | 56 | 57 | #region Decoder class 58 | 59 | /// 60 | /// Decoder for . 61 | /// 62 | private class UserInfoArgsDecoder : enc.StructDecoder 63 | { 64 | /// 65 | /// Create a new instance of type . 66 | /// 67 | /// The struct instance. 68 | protected override UserInfoArgs Create() 69 | { 70 | return new UserInfoArgs(); 71 | } 72 | 73 | /// 74 | /// Set given field. 75 | /// 76 | /// The field value. 77 | /// The field name. 78 | /// The json reader. 79 | protected override void SetField(UserInfoArgs value, string fieldName, enc.IJsonReader reader) 80 | { 81 | switch (fieldName) 82 | { 83 | default: 84 | reader.Skip(); 85 | break; 86 | } 87 | } 88 | } 89 | 90 | #endregion 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Examples/UniversalDemo/UniversalDemo/UniversalDemo.Windows/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 42 | 46 | 47 | 48 | 49 | 50 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/FileAddDetails.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api.TeamLog 6 | { 7 | using sys = System; 8 | using col = System.Collections.Generic; 9 | using re = System.Text.RegularExpressions; 10 | 11 | using enc = Dropbox.Api.Stone; 12 | 13 | /// 14 | /// Added files and/or folders. 15 | /// 16 | public class FileAddDetails 17 | { 18 | #pragma warning disable 108 19 | 20 | /// 21 | /// The encoder instance. 22 | /// 23 | internal static enc.StructEncoder Encoder = new FileAddDetailsEncoder(); 24 | 25 | /// 26 | /// The decoder instance. 27 | /// 28 | internal static enc.StructDecoder Decoder = new FileAddDetailsDecoder(); 29 | 30 | /// 31 | /// Initializes a new instance of the class. 32 | /// 33 | public FileAddDetails() 34 | { 35 | } 36 | 37 | #region Encoder class 38 | 39 | /// 40 | /// Encoder for . 41 | /// 42 | private class FileAddDetailsEncoder : enc.StructEncoder 43 | { 44 | /// 45 | /// Encode fields of given value. 46 | /// 47 | /// The value. 48 | /// The writer. 49 | public override void EncodeFields(FileAddDetails value, enc.IJsonWriter writer) 50 | { 51 | } 52 | } 53 | 54 | #endregion 55 | 56 | 57 | #region Decoder class 58 | 59 | /// 60 | /// Decoder for . 61 | /// 62 | private class FileAddDetailsDecoder : enc.StructDecoder 63 | { 64 | /// 65 | /// Create a new instance of type . 66 | /// 67 | /// The struct instance. 68 | protected override FileAddDetails Create() 69 | { 70 | return new FileAddDetails(); 71 | } 72 | 73 | /// 74 | /// Set given field. 75 | /// 76 | /// The field value. 77 | /// The field name. 78 | /// The json reader. 79 | protected override void SetField(FileAddDetails value, string fieldName, enc.IJsonReader reader) 80 | { 81 | switch (fieldName) 82 | { 83 | default: 84 | reader.Skip(); 85 | break; 86 | } 87 | } 88 | } 89 | 90 | #endregion 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/FileEditDetails.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api.TeamLog 6 | { 7 | using sys = System; 8 | using col = System.Collections.Generic; 9 | using re = System.Text.RegularExpressions; 10 | 11 | using enc = Dropbox.Api.Stone; 12 | 13 | /// 14 | /// Edited files. 15 | /// 16 | public class FileEditDetails 17 | { 18 | #pragma warning disable 108 19 | 20 | /// 21 | /// The encoder instance. 22 | /// 23 | internal static enc.StructEncoder Encoder = new FileEditDetailsEncoder(); 24 | 25 | /// 26 | /// The decoder instance. 27 | /// 28 | internal static enc.StructDecoder Decoder = new FileEditDetailsDecoder(); 29 | 30 | /// 31 | /// Initializes a new instance of the 32 | /// class. 33 | /// 34 | public FileEditDetails() 35 | { 36 | } 37 | 38 | #region Encoder class 39 | 40 | /// 41 | /// Encoder for . 42 | /// 43 | private class FileEditDetailsEncoder : enc.StructEncoder 44 | { 45 | /// 46 | /// Encode fields of given value. 47 | /// 48 | /// The value. 49 | /// The writer. 50 | public override void EncodeFields(FileEditDetails value, enc.IJsonWriter writer) 51 | { 52 | } 53 | } 54 | 55 | #endregion 56 | 57 | 58 | #region Decoder class 59 | 60 | /// 61 | /// Decoder for . 62 | /// 63 | private class FileEditDetailsDecoder : enc.StructDecoder 64 | { 65 | /// 66 | /// Create a new instance of type . 67 | /// 68 | /// The struct instance. 69 | protected override FileEditDetails Create() 70 | { 71 | return new FileEditDetails(); 72 | } 73 | 74 | /// 75 | /// Set given field. 76 | /// 77 | /// The field value. 78 | /// The field name. 79 | /// The json reader. 80 | protected override void SetField(FileEditDetails value, string fieldName, enc.IJsonReader reader) 81 | { 82 | switch (fieldName) 83 | { 84 | default: 85 | reader.Skip(); 86 | break; 87 | } 88 | } 89 | } 90 | 91 | #endregion 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/TfaResetDetails.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api.TeamLog 6 | { 7 | using sys = System; 8 | using col = System.Collections.Generic; 9 | using re = System.Text.RegularExpressions; 10 | 11 | using enc = Dropbox.Api.Stone; 12 | 13 | /// 14 | /// Reset two-step verification for team member. 15 | /// 16 | public class TfaResetDetails 17 | { 18 | #pragma warning disable 108 19 | 20 | /// 21 | /// The encoder instance. 22 | /// 23 | internal static enc.StructEncoder Encoder = new TfaResetDetailsEncoder(); 24 | 25 | /// 26 | /// The decoder instance. 27 | /// 28 | internal static enc.StructDecoder Decoder = new TfaResetDetailsDecoder(); 29 | 30 | /// 31 | /// Initializes a new instance of the 32 | /// class. 33 | /// 34 | public TfaResetDetails() 35 | { 36 | } 37 | 38 | #region Encoder class 39 | 40 | /// 41 | /// Encoder for . 42 | /// 43 | private class TfaResetDetailsEncoder : enc.StructEncoder 44 | { 45 | /// 46 | /// Encode fields of given value. 47 | /// 48 | /// The value. 49 | /// The writer. 50 | public override void EncodeFields(TfaResetDetails value, enc.IJsonWriter writer) 51 | { 52 | } 53 | } 54 | 55 | #endregion 56 | 57 | 58 | #region Decoder class 59 | 60 | /// 61 | /// Decoder for . 62 | /// 63 | private class TfaResetDetailsDecoder : enc.StructDecoder 64 | { 65 | /// 66 | /// Create a new instance of type . 67 | /// 68 | /// The struct instance. 69 | protected override TfaResetDetails Create() 70 | { 71 | return new TfaResetDetails(); 72 | } 73 | 74 | /// 75 | /// Set given field. 76 | /// 77 | /// The field value. 78 | /// The field name. 79 | /// The json reader. 80 | protected override void SetField(TfaResetDetails value, string fieldName, enc.IJsonReader reader) 81 | { 82 | switch (fieldName) 83 | { 84 | default: 85 | reader.Skip(); 86 | break; 87 | } 88 | } 89 | } 90 | 91 | #endregion 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/GroupMovedDetails.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api.TeamLog 6 | { 7 | using sys = System; 8 | using col = System.Collections.Generic; 9 | using re = System.Text.RegularExpressions; 10 | 11 | using enc = Dropbox.Api.Stone; 12 | 13 | /// 14 | /// Moved group. 15 | /// 16 | public class GroupMovedDetails 17 | { 18 | #pragma warning disable 108 19 | 20 | /// 21 | /// The encoder instance. 22 | /// 23 | internal static enc.StructEncoder Encoder = new GroupMovedDetailsEncoder(); 24 | 25 | /// 26 | /// The decoder instance. 27 | /// 28 | internal static enc.StructDecoder Decoder = new GroupMovedDetailsDecoder(); 29 | 30 | /// 31 | /// Initializes a new instance of the 32 | /// class. 33 | /// 34 | public GroupMovedDetails() 35 | { 36 | } 37 | 38 | #region Encoder class 39 | 40 | /// 41 | /// Encoder for . 42 | /// 43 | private class GroupMovedDetailsEncoder : enc.StructEncoder 44 | { 45 | /// 46 | /// Encode fields of given value. 47 | /// 48 | /// The value. 49 | /// The writer. 50 | public override void EncodeFields(GroupMovedDetails value, enc.IJsonWriter writer) 51 | { 52 | } 53 | } 54 | 55 | #endregion 56 | 57 | 58 | #region Decoder class 59 | 60 | /// 61 | /// Decoder for . 62 | /// 63 | private class GroupMovedDetailsDecoder : enc.StructDecoder 64 | { 65 | /// 66 | /// Create a new instance of type . 67 | /// 68 | /// The struct instance. 69 | protected override GroupMovedDetails Create() 70 | { 71 | return new GroupMovedDetails(); 72 | } 73 | 74 | /// 75 | /// Set given field. 76 | /// 77 | /// The field value. 78 | /// The field name. 79 | /// The json reader. 80 | protected override void SetField(GroupMovedDetails value, string fieldName, enc.IJsonReader reader) 81 | { 82 | switch (fieldName) 83 | { 84 | default: 85 | reader.Skip(); 86 | break; 87 | } 88 | } 89 | } 90 | 91 | #endregion 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/NoteSharedDetails.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api.TeamLog 6 | { 7 | using sys = System; 8 | using col = System.Collections.Generic; 9 | using re = System.Text.RegularExpressions; 10 | 11 | using enc = Dropbox.Api.Stone; 12 | 13 | /// 14 | /// Shared Paper doc. 15 | /// 16 | public class NoteSharedDetails 17 | { 18 | #pragma warning disable 108 19 | 20 | /// 21 | /// The encoder instance. 22 | /// 23 | internal static enc.StructEncoder Encoder = new NoteSharedDetailsEncoder(); 24 | 25 | /// 26 | /// The decoder instance. 27 | /// 28 | internal static enc.StructDecoder Decoder = new NoteSharedDetailsDecoder(); 29 | 30 | /// 31 | /// Initializes a new instance of the 32 | /// class. 33 | /// 34 | public NoteSharedDetails() 35 | { 36 | } 37 | 38 | #region Encoder class 39 | 40 | /// 41 | /// Encoder for . 42 | /// 43 | private class NoteSharedDetailsEncoder : enc.StructEncoder 44 | { 45 | /// 46 | /// Encode fields of given value. 47 | /// 48 | /// The value. 49 | /// The writer. 50 | public override void EncodeFields(NoteSharedDetails value, enc.IJsonWriter writer) 51 | { 52 | } 53 | } 54 | 55 | #endregion 56 | 57 | 58 | #region Decoder class 59 | 60 | /// 61 | /// Decoder for . 62 | /// 63 | private class NoteSharedDetailsDecoder : enc.StructDecoder 64 | { 65 | /// 66 | /// Create a new instance of type . 67 | /// 68 | /// The struct instance. 69 | protected override NoteSharedDetails Create() 70 | { 71 | return new NoteSharedDetails(); 72 | } 73 | 74 | /// 75 | /// Set given field. 76 | /// 77 | /// The field value. 78 | /// The field name. 79 | /// The json reader. 80 | protected override void SetField(NoteSharedDetails value, string fieldName, enc.IJsonReader reader) 81 | { 82 | switch (fieldName) 83 | { 84 | default: 85 | reader.Skip(); 86 | break; 87 | } 88 | } 89 | } 90 | 91 | #endregion 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/FileDeleteDetails.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api.TeamLog 6 | { 7 | using sys = System; 8 | using col = System.Collections.Generic; 9 | using re = System.Text.RegularExpressions; 10 | 11 | using enc = Dropbox.Api.Stone; 12 | 13 | /// 14 | /// Deleted files and/or folders. 15 | /// 16 | public class FileDeleteDetails 17 | { 18 | #pragma warning disable 108 19 | 20 | /// 21 | /// The encoder instance. 22 | /// 23 | internal static enc.StructEncoder Encoder = new FileDeleteDetailsEncoder(); 24 | 25 | /// 26 | /// The decoder instance. 27 | /// 28 | internal static enc.StructDecoder Decoder = new FileDeleteDetailsDecoder(); 29 | 30 | /// 31 | /// Initializes a new instance of the 32 | /// class. 33 | /// 34 | public FileDeleteDetails() 35 | { 36 | } 37 | 38 | #region Encoder class 39 | 40 | /// 41 | /// Encoder for . 42 | /// 43 | private class FileDeleteDetailsEncoder : enc.StructEncoder 44 | { 45 | /// 46 | /// Encode fields of given value. 47 | /// 48 | /// The value. 49 | /// The writer. 50 | public override void EncodeFields(FileDeleteDetails value, enc.IJsonWriter writer) 51 | { 52 | } 53 | } 54 | 55 | #endregion 56 | 57 | 58 | #region Decoder class 59 | 60 | /// 61 | /// Decoder for . 62 | /// 63 | private class FileDeleteDetailsDecoder : enc.StructDecoder 64 | { 65 | /// 66 | /// Create a new instance of type . 67 | /// 68 | /// The struct instance. 69 | protected override FileDeleteDetails Create() 70 | { 71 | return new FileDeleteDetails(); 72 | } 73 | 74 | /// 75 | /// Set given field. 76 | /// 77 | /// The field value. 78 | /// The field name. 79 | /// The json reader. 80 | protected override void SetField(FileDeleteDetails value, string fieldName, enc.IJsonReader reader) 81 | { 82 | switch (fieldName) 83 | { 84 | default: 85 | reader.Skip(); 86 | break; 87 | } 88 | } 89 | } 90 | 91 | #endregion 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/FileRevertDetails.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api.TeamLog 6 | { 7 | using sys = System; 8 | using col = System.Collections.Generic; 9 | using re = System.Text.RegularExpressions; 10 | 11 | using enc = Dropbox.Api.Stone; 12 | 13 | /// 14 | /// Reverted files to previous version. 15 | /// 16 | public class FileRevertDetails 17 | { 18 | #pragma warning disable 108 19 | 20 | /// 21 | /// The encoder instance. 22 | /// 23 | internal static enc.StructEncoder Encoder = new FileRevertDetailsEncoder(); 24 | 25 | /// 26 | /// The decoder instance. 27 | /// 28 | internal static enc.StructDecoder Decoder = new FileRevertDetailsDecoder(); 29 | 30 | /// 31 | /// Initializes a new instance of the 32 | /// class. 33 | /// 34 | public FileRevertDetails() 35 | { 36 | } 37 | 38 | #region Encoder class 39 | 40 | /// 41 | /// Encoder for . 42 | /// 43 | private class FileRevertDetailsEncoder : enc.StructEncoder 44 | { 45 | /// 46 | /// Encode fields of given value. 47 | /// 48 | /// The value. 49 | /// The writer. 50 | public override void EncodeFields(FileRevertDetails value, enc.IJsonWriter writer) 51 | { 52 | } 53 | } 54 | 55 | #endregion 56 | 57 | 58 | #region Decoder class 59 | 60 | /// 61 | /// Decoder for . 62 | /// 63 | private class FileRevertDetailsDecoder : enc.StructDecoder 64 | { 65 | /// 66 | /// Create a new instance of type . 67 | /// 68 | /// The struct instance. 69 | protected override FileRevertDetails Create() 70 | { 71 | return new FileRevertDetails(); 72 | } 73 | 74 | /// 75 | /// Set given field. 76 | /// 77 | /// The field value. 78 | /// The field name. 79 | /// The json reader. 80 | protected override void SetField(FileRevertDetails value, string fieldName, enc.IJsonReader reader) 81 | { 82 | switch (fieldName) 83 | { 84 | default: 85 | reader.Skip(); 86 | break; 87 | } 88 | } 89 | } 90 | 91 | #endregion 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/FilePreviewDetails.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api.TeamLog 6 | { 7 | using sys = System; 8 | using col = System.Collections.Generic; 9 | using re = System.Text.RegularExpressions; 10 | 11 | using enc = Dropbox.Api.Stone; 12 | 13 | /// 14 | /// Previewed files and/or folders. 15 | /// 16 | public class FilePreviewDetails 17 | { 18 | #pragma warning disable 108 19 | 20 | /// 21 | /// The encoder instance. 22 | /// 23 | internal static enc.StructEncoder Encoder = new FilePreviewDetailsEncoder(); 24 | 25 | /// 26 | /// The decoder instance. 27 | /// 28 | internal static enc.StructDecoder Decoder = new FilePreviewDetailsDecoder(); 29 | 30 | /// 31 | /// Initializes a new instance of the 32 | /// class. 33 | /// 34 | public FilePreviewDetails() 35 | { 36 | } 37 | 38 | #region Encoder class 39 | 40 | /// 41 | /// Encoder for . 42 | /// 43 | private class FilePreviewDetailsEncoder : enc.StructEncoder 44 | { 45 | /// 46 | /// Encode fields of given value. 47 | /// 48 | /// The value. 49 | /// The writer. 50 | public override void EncodeFields(FilePreviewDetails value, enc.IJsonWriter writer) 51 | { 52 | } 53 | } 54 | 55 | #endregion 56 | 57 | 58 | #region Decoder class 59 | 60 | /// 61 | /// Decoder for . 62 | /// 63 | private class FilePreviewDetailsDecoder : enc.StructDecoder 64 | { 65 | /// 66 | /// Create a new instance of type . 67 | /// 68 | /// The struct instance. 69 | protected override FilePreviewDetails Create() 70 | { 71 | return new FilePreviewDetails(); 72 | } 73 | 74 | /// 75 | /// Set given field. 76 | /// 77 | /// The field value. 78 | /// The field name. 79 | /// The json reader. 80 | protected override void SetField(FilePreviewDetails value, string fieldName, enc.IJsonReader reader) 81 | { 82 | switch (fieldName) 83 | { 84 | default: 85 | reader.Skip(); 86 | break; 87 | } 88 | } 89 | } 90 | 91 | #endregion 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/CreateFolderDetails.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Auto-generated by StoneAPI, do not modify. 3 | // 4 | 5 | namespace Dropbox.Api.TeamLog 6 | { 7 | using sys = System; 8 | using col = System.Collections.Generic; 9 | using re = System.Text.RegularExpressions; 10 | 11 | using enc = Dropbox.Api.Stone; 12 | 13 | /// 14 | /// Created folders. 15 | /// 16 | public class CreateFolderDetails 17 | { 18 | #pragma warning disable 108 19 | 20 | /// 21 | /// The encoder instance. 22 | /// 23 | internal static enc.StructEncoder Encoder = new CreateFolderDetailsEncoder(); 24 | 25 | /// 26 | /// The decoder instance. 27 | /// 28 | internal static enc.StructDecoder Decoder = new CreateFolderDetailsDecoder(); 29 | 30 | /// 31 | /// Initializes a new instance of the 32 | /// class. 33 | /// 34 | public CreateFolderDetails() 35 | { 36 | } 37 | 38 | #region Encoder class 39 | 40 | /// 41 | /// Encoder for . 42 | /// 43 | private class CreateFolderDetailsEncoder : enc.StructEncoder 44 | { 45 | /// 46 | /// Encode fields of given value. 47 | /// 48 | /// The value. 49 | /// The writer. 50 | public override void EncodeFields(CreateFolderDetails value, enc.IJsonWriter writer) 51 | { 52 | } 53 | } 54 | 55 | #endregion 56 | 57 | 58 | #region Decoder class 59 | 60 | /// 61 | /// Decoder for . 62 | /// 63 | private class CreateFolderDetailsDecoder : enc.StructDecoder 64 | { 65 | /// 66 | /// Create a new instance of type . 67 | /// 68 | /// The struct instance. 69 | protected override CreateFolderDetails Create() 70 | { 71 | return new CreateFolderDetails(); 72 | } 73 | 74 | /// 75 | /// Set given field. 76 | /// 77 | /// The field value. 78 | /// The field name. 79 | /// The json reader. 80 | protected override void SetField(CreateFolderDetails value, string fieldName, enc.IJsonReader reader) 81 | { 82 | switch (fieldName) 83 | { 84 | default: 85 | reader.Skip(); 86 | break; 87 | } 88 | } 89 | } 90 | 91 | #endregion 92 | } 93 | } 94 | --------------------------------------------------------------------------------