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
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
}
}

public event PropertyChangedEventHandler PropertyChanged;
public event PropertyChangedEventHandler? PropertyChanged;
public event EventHandler<Exception>? ErrorOccurred;

public void Power(int outlet, bool state)
{
try
{
var c = new WebClient();

Check warning on line 42 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 42 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 42 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 42 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 42 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 42 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 42 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 42 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 42 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 42 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 42 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 42 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)
c.Credentials = new NetworkCredential("admin", "admin");
var commandUri = string.Format("http://{0}/cmd.cgi?$A3 {1} {2}", _ipAddress, outlet, state ? 1 : 0);
var response = c.DownloadString(commandUri);
Expand All @@ -56,7 +56,7 @@
{
try
{
var c = new WebClient();

Check warning on line 59 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 59 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 59 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 59 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 59 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 59 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 59 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 59 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 59 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 59 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 59 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)

Check warning on line 59 in ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/NetBooterLink.cs

View workflow job for this annotation

GitHub Actions / Build and push Nuget package

'WebClient.WebClient()' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.' (https://aka.ms/dotnet-warnings/SYSLIB0014)
c.Credentials = new NetworkCredential("admin", "admin");
var commandUri = string.Format("http://{0}/cmd.cgi?$A5", _ipAddress);
var response = c.DownloadString(commandUri);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFrameworks>net10.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFrameworks>net10.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void Dispose()
_serialLink.Dispose();
}

private void OnDataReceived(object sender, EventArgs e)
private void OnDataReceived(object? sender, EventArgs e)
{
bool hasNewData = false;

Expand Down Expand Up @@ -239,7 +239,7 @@ private void OnDataReceived(object sender, EventArgs e)
}
}

private void OnErrorOccurred(object sender, Exception ex)
private void OnErrorOccurred(object? sender, Exception ex)
{
ErrorOccurred?.Invoke(sender, ex);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFrameworks>net10.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFrameworks>net10.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions ThreeByte.LinkLib/ThreeByte.LinkLib.TcpLink/AsyncTcpLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private void SafeClose()
ChangeIsConnected(false);
}

private void SafeConnect(object state)
private void SafeConnect(object? state)
{
SafeConnect();
}
Expand Down Expand Up @@ -325,7 +325,7 @@ private void ReceiveData()

private void ReadCallback(IAsyncResult asyncResult)
{
byte[] buffer = (byte[])asyncResult.AsyncState ?? Array.Empty<byte>();
byte[] buffer = (byte[]?)asyncResult.AsyncState ?? Array.Empty<byte>();
bool hasNewData = false;
int bytesRead = 0;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFrameworks>net10.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private void ReceiveCallback(IAsyncResult asyncResult)
{
try
{
IPEndPoint remoteEndpoint = new IPEndPoint(IPAddress.Any, _settings.RemotePort);
IPEndPoint? remoteEndpoint = new IPEndPoint(IPAddress.Any, _settings.RemotePort);
byte[] bytesRead = _udpClient?.EndReceive(asyncResult, ref remoteEndpoint) ?? Array.Empty<byte>();

if (_isEnabled)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Nullable>enable</Nullable>
<TargetFrameworks>net10.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading