aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2021-03-10 15:16:39 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2021-03-10 15:16:39 +0200
commit59d8d9f374dd6b2dc5ef938a5fb1ddece1d47c43 (patch)
tree68d83b9c6dabc426e8f204e8849ddbfc5e1d45aa /Software/Visual_Studio/PPC
parent3dfab420fe594d83c5382107b4f80bdeab9ddc44 (diff)
downloadTango-59d8d9f374dd6b2dc5ef938a5fb1ddece1d47c43.tar.gz
Tango-59d8d9f374dd6b2dc5ef938a5fb1ddece1d47c43.zip
Changed PPC internet connection check based on windows report.
Diffstat (limited to 'Software/Visual_Studio/PPC')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs11
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj3
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config1
3 files changed, 8 insertions, 7 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs
index 5218d9f70..a2275a72d 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs
@@ -1,4 +1,5 @@
-using System;
+using Microsoft.WindowsAPICodePack.Net;
+using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
@@ -269,15 +270,11 @@ namespace Tango.PPC.UI.Connectivity
{
try
{
- using (var client = new WebClient())
- using (client.OpenRead("http://clients3.google.com/generate_204"))
- {
- return true;
- }
+ return NetworkListManager.GetNetworks(NetworkConnectivityLevels.Connected).Any(x => x.IsConnectedToInternet);
}
catch
{
- return false;
+ return true;
}
});
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
index 9e4256738..79ba27e75 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
@@ -69,6 +69,9 @@
<Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
+ <Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\Microsoft.WindowsAPICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
+ </Reference>
<Reference Include="SimpleValidator, Version=0.6.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\SimpleValidator.0.6.1.0\lib\net40\SimpleValidator.dll</HintPath>
</Reference>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config
index a8eab2a66..ec7ec1e3a 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config
@@ -5,6 +5,7 @@
<package id="Expression.Blend.Sdk" version="1.0.2" targetFramework="net46" />
<package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net46" />
<package id="Google.Protobuf" version="3.4.1" targetFramework="net46" />
+ <package id="Microsoft.WindowsAPICodePack-Core" version="1.1.0.0" targetFramework="net461" />
<package id="SimpleValidator" version="0.6.1.0" targetFramework="net46" />
<package id="System.Data.SQLite" version="1.0.108.0" targetFramework="net46" />
<package id="System.Data.SQLite.Core" version="1.0.108.0" targetFramework="net46" />