Skip to content

Commit

Permalink
Fix file naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Corsaro authored and Foda committed Jan 8, 2024
1 parent fb2f9c9 commit 7f31319
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Collections.Generic;
using System.Runtime.InteropServices;

namespace Microsoft.Maui.Essentials.Connectivity
namespace Microsoft.Maui.Networking
{
#if WINDOWS
internal class ConnectivityNativeHelper
Expand Down
15 changes: 7 additions & 8 deletions src/Essentials/src/Connectivity/Connectivity.uwp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Net.NetworkInformation;
using Windows.Networking.Connectivity;
using static Microsoft.Maui.Essentials.Connectivity.ConnectivityNativeHelper;

namespace Microsoft.Maui.Networking
{
Expand Down Expand Up @@ -39,11 +38,11 @@ public NetworkAccess NetworkAccess
else
{
// Windows 10 workaround for
var networkList = GetNetworkListManager();
var enumNetworks = networkList.GetNetworks(NLM_ENUM_NETWORK.NLM_ENUM_NETWORK_CONNECTED);
var connectivity = NLM_CONNECTIVITY.NLM_CONNECTIVITY_DISCONNECTED;
var networkList = ConnectivityNativeHelper.GetNetworkListManager();
var enumNetworks = networkList.GetNetworks(ConnectivityNativeHelper.NLM_ENUM_NETWORK.NLM_ENUM_NETWORK_CONNECTED);
var connectivity = ConnectivityNativeHelper.NLM_CONNECTIVITY.NLM_CONNECTIVITY_DISCONNECTED;

foreach (INetwork networkInterface in enumNetworks)
foreach (ConnectivityNativeHelper.INetwork networkInterface in enumNetworks)
{
if (networkInterface.IsConnected())
{
Expand All @@ -52,15 +51,15 @@ public NetworkAccess NetworkAccess
}
}

if ((connectivity & (NLM_CONNECTIVITY.NLM_CONNECTIVITY_IPV4_INTERNET | NLM_CONNECTIVITY.NLM_CONNECTIVITY_IPV6_INTERNET)) != 0)
if ((connectivity & (ConnectivityNativeHelper.NLM_CONNECTIVITY.NLM_CONNECTIVITY_IPV4_INTERNET | ConnectivityNativeHelper.NLM_CONNECTIVITY.NLM_CONNECTIVITY_IPV6_INTERNET)) != 0)
{
return NetworkAccess.Internet;
}
else if ((connectivity & (NLM_CONNECTIVITY.NLM_CONNECTIVITY_IPV4_LOCALNETWORK | NLM_CONNECTIVITY.NLM_CONNECTIVITY_IPV6_LOCALNETWORK)) != 0)
else if ((connectivity & (ConnectivityNativeHelper.NLM_CONNECTIVITY.NLM_CONNECTIVITY_IPV4_LOCALNETWORK | ConnectivityNativeHelper.NLM_CONNECTIVITY.NLM_CONNECTIVITY_IPV6_LOCALNETWORK)) != 0)
{
return NetworkAccess.Local;
}
else if ((connectivity & (NLM_CONNECTIVITY.NLM_CONNECTIVITY_IPV4_NOTRAFFIC | NLM_CONNECTIVITY.NLM_CONNECTIVITY_IPV6_NOTRAFFIC)) != 0)
else if ((connectivity & (ConnectivityNativeHelper.NLM_CONNECTIVITY.NLM_CONNECTIVITY_IPV4_NOTRAFFIC | ConnectivityNativeHelper.NLM_CONNECTIVITY.NLM_CONNECTIVITY_IPV6_NOTRAFFIC)) != 0)
{
return NetworkAccess.Local;
}
Expand Down

0 comments on commit 7f31319

Please sign in to comment.