Skip to content

Commit

Permalink
feat: Implement GetConnectionProfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
morning4coffe-dev committed Jan 6, 2024
1 parent 2b7be5f commit 06a73c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static partial class NetworkInformation
throw new global::System.NotImplementedException("The member IAsyncOperation<IReadOnlyList<ConnectionProfile>> NetworkInformation.FindConnectionProfilesAsync(ConnectionProfileFilter pProfileFilter) is not implemented. For more information, visit https://aka.platform.uno/notimplemented#m=IAsyncOperation%3CIReadOnlyList%3CConnectionProfile%3E%3E%20NetworkInformation.FindConnectionProfilesAsync%28ConnectionProfileFilter%20pProfileFilter%29");
}
#endif
#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false || false || IS_UNIT_TESTS || false || false || false || false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public static global::System.Collections.Generic.IReadOnlyList<global::Windows.Networking.Connectivity.ConnectionProfile> GetConnectionProfiles()
{
Expand Down
7 changes: 7 additions & 0 deletions src/Uno.UWP/Networking/Connectivity/NetworkInformation.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#if !IS_UNIT_TESTS
#nullable enable

using System.Collections.Generic;
using Uno.Helpers;

namespace Windows.Networking.Connectivity;
Expand All @@ -26,6 +27,12 @@ static NetworkInformation()
/// or null if there is no connection profile with a suitable connection.</returns>
public static ConnectionProfile GetInternetConnectionProfile() => ConnectionProfile.GetInternetConnectionProfile();

/// <summary>
/// Gets a list of profiles for connections, active or otherwise, on the local machine.
/// </summary>
/// <returns>An array of ConnectionProfile objects.</returns>
public static IReadOnlyList<ConnectionProfile> GetConnectionProfiles() => [ConnectionProfile.GetInternetConnectionProfile()];

/// <summary>
/// Occurs when the network status changes for a connection.
/// </summary>
Expand Down

0 comments on commit 06a73c6

Please sign in to comment.