Skip to content

Commit 6c48892

Browse files
author
Ahmad Noman Musleh
committed
Changed target framework to .NET 6
1 parent aa56491 commit 6c48892

6 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/OpenAPI.Net/Helpers/NameValueCollectionToQueryString.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static string ToQueryString(this NameValueCollection collection)
1010
{
1111
if (collection == null) return string.Empty;
1212

13-
StringBuilder stringBuilder = new StringBuilder();
13+
StringBuilder stringBuilder = new();
1414

1515
foreach (string key in collection.Keys)
1616
{

src/OpenAPI.Net/OpenAPI.Net.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.1</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
66
<PackageLicenseExpression>MIT</PackageLicenseExpression>
77
<PackageProjectUrl>https://github.com/spotware/OpenAPI.Net</PackageProjectUrl>
88
<RepositoryUrl>https://github.com/spotware/OpenAPI.Net</RepositoryUrl>
9-
<PackageTags>cTrader, Open API, Spotware</PackageTags>
10-
<Description>A .NET RX library for Spotware Open API</Description>
11-
<PackageId>Spotware.OpenAPI.Net</PackageId>
9+
<PackageTags>cTrader, Open API, Spotware, cTrader</PackageTags>
10+
<Description>A .NET RX library for cTrader Open API</Description>
11+
<PackageId>cTrader.OpenAPI.Net</PackageId>
1212
<Version>1.4.0-rc0</Version>
1313
<Platforms>AnyCPU</Platforms>
1414
<Company>Spotware</Company>

src/OpenAPI.Net/OpenClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ public sealed class OpenClient : IDisposable, IObservable<IMessage>
2121
{
2222
private readonly TimeSpan _heartbeatInerval;
2323

24-
private readonly ProtoHeartbeatEvent _heartbeatEvent = new ProtoHeartbeatEvent();
24+
private readonly ProtoHeartbeatEvent _heartbeatEvent = new();
2525

2626
private readonly Channel<ProtoMessage> _messagesChannel = Channel.CreateUnbounded<ProtoMessage>();
2727

28-
private readonly ConcurrentDictionary<int, IObserver<IMessage>> _observers = new ConcurrentDictionary<int, IObserver<IMessage>>();
28+
private readonly ConcurrentDictionary<int, IObserver<IMessage>> _observers = new();
2929

30-
private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
30+
private readonly CancellationTokenSource _cancellationTokenSource = new();
3131

3232
private readonly TimeSpan _requestDelay;
3333

src/WPF.Sample/App.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ protected override void RegisterTypes(IContainerRegistry containerRegistry)
5454
containerRegistry.RegisterDialog<AccountAuthView>();
5555

5656
// Services
57-
OpenClient liveClientFactory() => new OpenClient(ApiInfo.LiveHost, ApiInfo.Port, TimeSpan.FromSeconds(10));
58-
OpenClient demoClientFactory() => new OpenClient(ApiInfo.DemoHost, ApiInfo.Port, TimeSpan.FromSeconds(10));
57+
OpenClient liveClientFactory() => new(ApiInfo.LiveHost, ApiInfo.Port, TimeSpan.FromSeconds(10));
58+
OpenClient demoClientFactory() => new(ApiInfo.DemoHost, ApiInfo.Port, TimeSpan.FromSeconds(10));
5959

6060
var apiService = new ApiService(liveClientFactory, demoClientFactory);
6161

src/WPF.Sample/Services/ChartingService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public interface IChartingService : IDisposable
1212

1313
public sealed class ChartingService : IChartingService
1414
{
15-
private readonly List<IDisposable> _disposables = new List<IDisposable>();
15+
private readonly List<IDisposable> _disposables = new();
1616

1717
public void Dispose()
1818
{

src/WinForms.Sample/Main.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public partial class Main : Form
3535
// private int _apiPort = 5035;
3636
private readonly OpenClient _client;
3737

38-
private static Queue _writeQueue = new Queue(); // not thread safe
39-
private static Queue _readQueue = new Queue(); // not thread safe
38+
private static Queue _writeQueue = new(); // not thread safe
39+
private static Queue _readQueue = new(); // not thread safe
4040
private static Queue writeQueueSync = Queue.Synchronized(_writeQueue); // thread safe
4141
private static Queue readQueueSync = Queue.Synchronized(_readQueue); // thread safe
4242
private static volatile bool isShutdown;

0 commit comments

Comments
 (0)