Skip to content

Commit

Permalink
Added multiple .NET framework versions support
Browse files Browse the repository at this point in the history
  • Loading branch information
khrabrovart committed Jun 4, 2017
1 parent 2b70716 commit cc0a789
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
3 changes: 1 addition & 2 deletions Citrina/CallbackApi/CallbackEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ internal class CallbackEventHandler : ICallbackEventHandler

public CallbackEventType GetEventType(CallbackEvent e)
{
CallbackEventType type;
if (!EventMap.TryGetValue(e.Type, out type))
if (!EventMap.TryGetValue(e.Type, out CallbackEventType type))
{
return CallbackEventType.Undefined;
}
Expand Down
36 changes: 23 additions & 13 deletions Citrina/Citrina.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Configuration">
<DocumentationFile>bin\Release\Citrina.xml</DocumentationFile>
<OutputPath />
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<TargetFrameworks>netstandard1.3;net45;net46</TargetFrameworks>
<PackageId>Citrina</PackageId>
<Title>Citrina (VK API for .NET)</Title>
<Summary>Citrina is a first full-blown high-performance VK (VKontakte) API realization for .NET that offers full support of all existing methods. Docs: https://github.com/khrabrovart/Citrina </Summary>
Expand All @@ -14,31 +15,40 @@
<PackageProjectUrl>https://github.com/khrabrovart/Citrina</PackageProjectUrl>
<Description>Citrina is a first full-blown high-performance VK (VKontakte) API realization for .NET that offers full support of all existing methods. Docs: https://github.com/khrabrovart/Citrina </Description>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>
Symbols and sources included in the package

Docs: https://github.com/khrabrovart/Citrina
</PackageReleaseNotes>
<PackageReleaseNotes>Added .NETFramework 4.5 and .NETFramework 4.6 support.
Docs: https://github.com/khrabrovart/Citrina
</PackageReleaseNotes>
<Copyright>Copyright 2017 (C) Arthur Khrabrov. All rights reserved.</Copyright>
<PackageTags>vk api vkontakte vkapi</PackageTags>
<AssemblyVersion>2.4.0</AssemblyVersion>
<FileVersion>2.4.0</FileVersion>
<PackageVersion>2.4.0</PackageVersion>
<Version>2.4.0</Version>
<PackageLicenseUrl>https://github.com/khrabrovart/Citrina/blob/master/LICENSE.md</PackageLicenseUrl>
<AssemblyVersion>2.5.0</AssemblyVersion>
<FileVersion>2.5.0</FileVersion>
<PackageVersion>2.5.0</PackageVersion>
<Version>2.5.0</Version>
<PackageLicenseUrl>https://github.com/khrabrovart/Citrina/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/khrabrovart/Citrina</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSource>True</IncludeSource>
<IncludeSymbols>True</IncludeSymbols>
</PropertyGroup>

<ItemGroup>
<Compile Remove="obj\**" />
<EmbeddedResource Remove="obj\**" />
<None Remove="obj\**" />
</ItemGroup>
<ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net46'">
<Reference Include="System.Net.Http" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net46'">
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions Citrina/StandardApi/Core/HttpUploader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ public static async Task<UploadResponse<T>> UploadAsync<T>(string url, IEnumerab

using (var response = await client.PostAsync(url, content).ConfigureAwait(false))
{
#if NETSTANDARD1_3
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
#endif
var data = await response.Content.ReadAsStringAsync().ConfigureAwait(false);

try
Expand Down

0 comments on commit cc0a789

Please sign in to comment.