diff options
| author | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
| commit | 00a491d93733d4625ad329b2ba8237f445364b3f (patch) | |
| tree | 4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity | |
| parent | 124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff) | |
| download | Tango-00a491d9.tar.gz Tango-00a491d9.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs | 44 |
1 files changed, 1 insertions, 43 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..53e143def 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs @@ -4,7 +4,6 @@ using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using System.Net; -using System.Net.NetworkInformation; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -30,9 +29,7 @@ namespace Tango.PPC.UI.Connectivity private IMachineProvider _machineProvider; private Rfc2898Cryptographer _cryptographer; private System.Timers.Timer _updateTimer; - private System.Timers.Timer _lanUpdateTimer; private WiFiNetwork _connectedNetwork; - private PPCSettings _settings; /// <summary> /// Occurs when the connectivity provider state has changed (e.g network connected/disconnected). @@ -46,17 +43,7 @@ namespace Tango.PPC.UI.Connectivity public bool IsConnected { get { return _isConnected; } - private set { _isConnected = value; RaisePropertyChangedAuto(); } - } - - private bool _isLanConnected; - /// <summary> - /// Gets a value indicating whether there is LAN connection. - /// </summary> - public bool IsLanConnected - { - get { return _isLanConnected; } - private set { _isLanConnected = value; RaisePropertyChangedAuto(); } + set { _isConnected = value; RaisePropertyChangedAuto(); } } private bool _isHotspoActive; @@ -129,8 +116,6 @@ namespace Tango.PPC.UI.Connectivity { await RefreshAvailableWiFiNetworks(); }); - - _settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); } /// <summary> @@ -168,28 +153,6 @@ namespace Tango.PPC.UI.Connectivity _updateTimer = new System.Timers.Timer(TimeSpan.FromSeconds(30).TotalMilliseconds); _updateTimer.Elapsed += _updateTimer_Elapsed; _updateTimer.Start(); - - _lanUpdateTimer = new System.Timers.Timer(TimeSpan.FromSeconds(10).TotalMilliseconds); - _lanUpdateTimer.Elapsed += _lanUpdateTimer_Elapsed; - _lanUpdateTimer.Start(); - } - - private void _lanUpdateTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) - { - foreach (NetworkInterface net in NetworkInterface.GetAllNetworkInterfaces()) - { - if ((net.NetworkInterfaceType == NetworkInterfaceType.Ethernet - || net.NetworkInterfaceType == NetworkInterfaceType.Ethernet3Megabit - || net.NetworkInterfaceType == NetworkInterfaceType.FastEthernetFx - || net.NetworkInterfaceType == NetworkInterfaceType.FastEthernetT - || net.NetworkInterfaceType == NetworkInterfaceType.GigabitEthernet) && net.Name.ToStringOrEmpty().StartsWith("Ethernet") && net.OperationalStatus == OperationalStatus.Up) - { - IsLanConnected = true; - return; - } - } - - IsLanConnected = false; } /// <summary> @@ -260,11 +223,6 @@ namespace Tango.PPC.UI.Connectivity /// <returns></returns> public Task<bool> CheckInternetConnection() { - if (_settings.BypassInternetConnectivityCheck) - { - return Task.FromResult(true); - } - return Task.Factory.StartNew<bool>(() => { try |
