Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize examples #208

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Build SDK, Tests, and Examples
run: |
dotnet build dropbox-sdk-dotnet
- name: Run Unit Tests
# We don't have a good cross-platform way of splitting long lines
run: |
Expand Down
15 changes: 0 additions & 15 deletions dropbox-sdk-dotnet/.editorconfig

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ public class DropboxApiTests
/// <summary>
/// Set up Dropbox clients.
/// </summary>
/// <param name="context">The VSTest context.</param>
[ClassInitialize]
public static void ClassInitialize(TestContext context)
#pragma warning disable SA1313 // False positive for _ paramter
#pragma warning disable SA1611 // False positive for _ paramter
public static void ClassInitialize(TestContext _)
#pragma warning restore SA1313
#pragma warning restore SA1611
{
var config = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
Expand Down
3 changes: 2 additions & 1 deletion dropbox-sdk-dotnet/Dropbox.Api.Unit.Tests/UnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public class UnitTests
/// <summary>
/// Test get authorization url.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1000:KeywordsMustBeSpacedCorrectly", Justification = "False positive.")]
[TestMethod]
public void TestGetAuthorizationUri()
{
Expand All @@ -30,7 +29,9 @@ public void TestGetAuthorizationUri()
bool[] disableSignups = new[] { false, true };
string[] requireRoles = new[] { string.Empty, "role" };
bool[] forceReauthentications = new[] { false, true };
#pragma warning disable SA1000 // conflicts with IDE settings
List<string[]> scopes = new()
#pragma warning restore SA1000
{
null,
new string[] { "files.metadata.read", "files.content.read" },
Expand Down
52 changes: 1 addition & 51 deletions dropbox-sdk-dotnet/Dropbox.Api.sln
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleBlogDemo", "Examples\SimpleBlogDemo\SimpleBlogDemo.csproj", "{8772EB1E-3019-4FB3-9059-67681693E873}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleTest", "Examples\SimpleTest\SimpleTest.csproj", "{33A16535-A722-4679-BD9F-A78576988519}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "UniversalDemo.Shared", "Examples\UniversalDemo\UniversalDemo\UniversalDemo.Shared\UniversalDemo.Shared.shproj", "{6BCC4215-B726-4B37-A932-4DCA74A1D465}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalDemo.Windows", "Examples\UniversalDemo\UniversalDemo\UniversalDemo.Windows\UniversalDemo.Windows.csproj", "{680E8F6F-AA67-4912-AE20-F89E482DC2CD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalDemo.WindowsPhone", "Examples\UniversalDemo\UniversalDemo\UniversalDemo.WindowsPhone\UniversalDemo.WindowsPhone.csproj", "{51D9899C-31D6-4C22-B894-E9498CB90577}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dropbox.Api", "Dropbox.Api\Dropbox.Api.csproj", "{68180B54-4724-4CD1-BAA6-EE7BC309797C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleBusinessDashboard", "Examples\SimpleBusinessDashboard\SimpleBusinessDashboard.csproj", "{B762DE35-E606-4B57-8860-1A662DF5624C}"
Expand Down Expand Up @@ -72,50 +66,6 @@ Global
{33A16535-A722-4679-BD9F-A78576988519}.Release|x64.Build.0 = Release|Any CPU
{33A16535-A722-4679-BD9F-A78576988519}.Release|x86.ActiveCfg = Release|Any CPU
{33A16535-A722-4679-BD9F-A78576988519}.Release|x86.Build.0 = Release|Any CPU
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Debug|ARM.ActiveCfg = Debug|ARM
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Debug|ARM.Build.0 = Debug|ARM
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Debug|ARM.Deploy.0 = Debug|ARM
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Debug|x64.ActiveCfg = Debug|x64
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Debug|x64.Build.0 = Debug|x64
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Debug|x64.Deploy.0 = Debug|x64
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Debug|x86.ActiveCfg = Debug|x86
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Debug|x86.Build.0 = Debug|x86
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Debug|x86.Deploy.0 = Debug|x86
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Release|Any CPU.Build.0 = Release|Any CPU
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Release|Any CPU.Deploy.0 = Release|Any CPU
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Release|ARM.ActiveCfg = Release|ARM
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Release|ARM.Build.0 = Release|ARM
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Release|ARM.Deploy.0 = Release|ARM
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Release|x64.ActiveCfg = Release|x64
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Release|x64.Build.0 = Release|x64
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Release|x64.Deploy.0 = Release|x64
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Release|x86.ActiveCfg = Release|x86
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Release|x86.Build.0 = Release|x86
{680E8F6F-AA67-4912-AE20-F89E482DC2CD}.Release|x86.Deploy.0 = Release|x86
{51D9899C-31D6-4C22-B894-E9498CB90577}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{51D9899C-31D6-4C22-B894-E9498CB90577}.Debug|Any CPU.Build.0 = Debug|Any CPU
{51D9899C-31D6-4C22-B894-E9498CB90577}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{51D9899C-31D6-4C22-B894-E9498CB90577}.Debug|ARM.ActiveCfg = Debug|ARM
{51D9899C-31D6-4C22-B894-E9498CB90577}.Debug|ARM.Build.0 = Debug|ARM
{51D9899C-31D6-4C22-B894-E9498CB90577}.Debug|ARM.Deploy.0 = Debug|ARM
{51D9899C-31D6-4C22-B894-E9498CB90577}.Debug|x64.ActiveCfg = Debug|Any CPU
{51D9899C-31D6-4C22-B894-E9498CB90577}.Debug|x86.ActiveCfg = Debug|x86
{51D9899C-31D6-4C22-B894-E9498CB90577}.Debug|x86.Build.0 = Debug|x86
{51D9899C-31D6-4C22-B894-E9498CB90577}.Debug|x86.Deploy.0 = Debug|x86
{51D9899C-31D6-4C22-B894-E9498CB90577}.Release|Any CPU.ActiveCfg = Release|Any CPU
{51D9899C-31D6-4C22-B894-E9498CB90577}.Release|Any CPU.Build.0 = Release|Any CPU
{51D9899C-31D6-4C22-B894-E9498CB90577}.Release|Any CPU.Deploy.0 = Release|Any CPU
{51D9899C-31D6-4C22-B894-E9498CB90577}.Release|ARM.ActiveCfg = Release|ARM
{51D9899C-31D6-4C22-B894-E9498CB90577}.Release|ARM.Build.0 = Release|ARM
{51D9899C-31D6-4C22-B894-E9498CB90577}.Release|ARM.Deploy.0 = Release|ARM
{51D9899C-31D6-4C22-B894-E9498CB90577}.Release|x64.ActiveCfg = Release|Any CPU
{51D9899C-31D6-4C22-B894-E9498CB90577}.Release|x86.ActiveCfg = Release|x86
{51D9899C-31D6-4C22-B894-E9498CB90577}.Release|x86.Build.0 = Release|x86
{51D9899C-31D6-4C22-B894-E9498CB90577}.Release|x86.Deploy.0 = Release|x86
{68180B54-4724-4CD1-BAA6-EE7BC309797C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{68180B54-4724-4CD1-BAA6-EE7BC309797C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{68180B54-4724-4CD1-BAA6-EE7BC309797C}.Debug|ARM.ActiveCfg = Debug|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion dropbox-sdk-dotnet/Dropbox.Api/DropboxException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public partial class RateLimitException
{
/// <summary>
/// Initializes a new instance of the <see cref="RateLimitException"/> class.
/// <para>Initializes a new instance of the <see cref="requestId"/> class.</para>
/// <para>Initializes a new instance of the <see cref="RateLimitException"/> class.</para>
/// </summary>
/// <param name="requestId">The Dropbox request ID.</param>
internal RateLimitException(string requestId)
Expand Down
1 change: 1 addition & 0 deletions dropbox-sdk-dotnet/Examples/OAuthPKCE/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
settings.json
29 changes: 0 additions & 29 deletions dropbox-sdk-dotnet/Examples/OAuthPKCE/App.config

This file was deleted.

115 changes: 14 additions & 101 deletions dropbox-sdk-dotnet/Examples/OAuthPKCE/OAuthPKCE.csproj
Original file line number Diff line number Diff line change
@@ -1,108 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1DA8B62F-4AB9-4514-BE94-7D86BA4C130D}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OauthPKCE</RootNamespace>
<AssemblyName>OauthPKCE</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>8bfaafb2</NuGetPackageImportStamp>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<TargetFrameworkProfile />
<TargetFramework>net5.0</TargetFramework>
<CodeAnalysisRuleSet>../../stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<None Include="Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Extensions, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives, Version=4.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Dropbox.Api\Dropbox.Api.csproj">
<Project>{68180b54-4724-4cd1-baa6-ee7bc309797c}</Project>
<Name>Dropbox.Api</Name>
</ProjectReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<AdditionalFiles Include="../../stylecop.json" Link="stylecop.json" />
</ItemGroup>

<ItemGroup>
<Content Include="index.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<ProjectReference Include="../../Dropbox.Api/Dropbox.Api.csproj" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
<Error Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

</Project>
Loading