Skip to content
Merged
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
6 changes: 2 additions & 4 deletions examples/ExchangeSharpWinForms/ExchangeSharpWinForms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<ProjectGuid>{571623F9-1652-4669-8E17-A6FAD1426181}</ProjectGuid>
<OutputType>WinExe</OutputType>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<AssemblyTitle>ExchangeSharpWinForms</AssemblyTitle>
<Product>ExchangeSharpWinForms</Product>
Expand All @@ -21,9 +21,7 @@
</ItemGroup>

<ItemGroup>
<Compile Update="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="MainForm.cs" />
<Compile Update="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
Expand Down
7 changes: 6 additions & 1 deletion src/ExchangeSharp.Forms/ExchangeSharp.Forms.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<DefineConstants>HAS_WINDOWS_FORMS</DefineConstants>
<NeutralLanguage>en</NeutralLanguage>
<LangVersion>8</LangVersion>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>

<ItemGroup>
Expand All @@ -19,6 +20,10 @@
<None Include="../../LICENSE.txt" Link="LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Maikebing.System.Windows.Forms.DataVisualization" Version="5.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ExchangeSharp\ExchangeSharp.csproj" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ExchangeSharp.Forms/Forms/PlotForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/ExchangeSharp.Forms/Forms/PlotForm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
MIT LICENSE

Copyright 2017 Digital Ruby, LLC - http://www.digitalruby.com
Expand Down
10 changes: 9 additions & 1 deletion src/ExchangeSharp/API/Common/BaseAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The above copyright notice and this permission notice shall be included in all c
*/
#nullable enable
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
Expand Down Expand Up @@ -176,10 +177,17 @@ public IAPIRequestMaker RequestMaker
/// </summary>
public System.Security.SecureString? Passphrase { get; set; }

private static readonly ConcurrentDictionary<Type, RateGate> rateLimiters = new ConcurrentDictionary<Type, RateGate>();
private RateGate rateGate;
/// <summary>
/// Rate limiter - set this to a new limit if you are seeing your ip get blocked by the API
/// One rate limiter is created per type of api
/// </summary>
public RateGate RateLimit { get; set; } = new RateGate(5, TimeSpan.FromSeconds(15.0d));
public RateGate RateLimit
{
get => rateGate ??= rateLimiters.GetOrAdd(GetType(), v => new RateGate(5, TimeSpan.FromSeconds(15.0d)));
set => rateLimiters[GetType()] = rateGate = value;
}

/// <summary>
/// Default request method
Expand Down
2 changes: 1 addition & 1 deletion src/ExchangeSharp/API/Exchanges/_Base/ExchangeName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ internal static Type GetExchangeType(string exchangeName)
try
{
// make sure we have a valid type for the name
Type type = Type.GetType($"ExchangeSharp.Exchange{exchangeName}API");
Type type = Type.GetType($"ExchangeSharp.Exchange{exchangeName}API", true, true);

// we had better have a type sub-classing from ExchangeAPI
if (type is null || !type.IsSubclassOf(exchangeApiType))
Expand Down
2 changes: 1 addition & 1 deletion src/ExchangeSharpConsole/ExchangeSharpConsole.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<AssemblyName>exchange-sharp</AssemblyName>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<NeutralLanguage>en</NeutralLanguage>
<LangVersion>8</LangVersion>
<AssemblyVersion>0.9.1</AssemblyVersion>
Expand Down