diff --git a/src/Essentials/src/Accelerometer/Accelerometer.shared.cs b/src/Essentials/src/Accelerometer/Accelerometer.shared.cs index e4b6424b2b06..d4a023e50215 100644 --- a/src/Essentials/src/Accelerometer/Accelerometer.shared.cs +++ b/src/Essentials/src/Accelerometer/Accelerometer.shared.cs @@ -99,7 +99,11 @@ public static bool IsSupported public static IAccelerometer Default => defaultImplementation ??= new AccelerometerImplementation(); - internal static void SetDefault(IAccelerometer? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IAccelerometer? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Barometer/Barometer.shared.cs b/src/Essentials/src/Barometer/Barometer.shared.cs index 5d1009bca035..e33ab1250ab5 100644 --- a/src/Essentials/src/Barometer/Barometer.shared.cs +++ b/src/Essentials/src/Barometer/Barometer.shared.cs @@ -86,7 +86,11 @@ public static void Stop() public static IBarometer Default => defaultImplementation ??= new BarometerImplementation(); - internal static void SetDefault(IBarometer? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IBarometer? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Battery/Battery.shared.cs b/src/Essentials/src/Battery/Battery.shared.cs index 02b3c2380c33..b7db50ec1eba 100755 --- a/src/Essentials/src/Battery/Battery.shared.cs +++ b/src/Essentials/src/Battery/Battery.shared.cs @@ -98,7 +98,11 @@ public static event EventHandler EnergySaverS public static IBattery Default => defaultImplementation ??= new BatteryImplementation(); - internal static void SetDefault(IBattery? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IBattery? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Browser/Browser.shared.cs b/src/Essentials/src/Browser/Browser.shared.cs index 8f4e09ba3268..a11bb99809d7 100755 --- a/src/Essentials/src/Browser/Browser.shared.cs +++ b/src/Essentials/src/Browser/Browser.shared.cs @@ -77,7 +77,11 @@ public static class Browser public static IBrowser Default => defaultImplementation ??= new BrowserImplementation(); - internal static void SetDefault(IBrowser? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IBrowser? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Clipboard/Clipboard.shared.cs b/src/Essentials/src/Clipboard/Clipboard.shared.cs index 24cec45dd12b..1b454a5551fd 100644 --- a/src/Essentials/src/Clipboard/Clipboard.shared.cs +++ b/src/Essentials/src/Clipboard/Clipboard.shared.cs @@ -78,7 +78,11 @@ public static event EventHandler ClipboardContentChanged public static IClipboard Default => defaultImplementation ??= new ClipboardImplementation(); - internal static void SetDefault(IClipboard? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IClipboard? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Compass/Compass.shared.cs b/src/Essentials/src/Compass/Compass.shared.cs index daa3cc590824..7b35958dab83 100644 --- a/src/Essentials/src/Compass/Compass.shared.cs +++ b/src/Essentials/src/Compass/Compass.shared.cs @@ -142,7 +142,11 @@ public static bool ShouldDisplayHeadingCalibration public static ICompass Default => defaultImplementation ??= new CompassImplementation(); - internal static void SetDefault(ICompass? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(ICompass? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Contacts/Contacts.shared.cs b/src/Essentials/src/Contacts/Contacts.shared.cs index 42ba47ab7077..85c78a07b915 100644 --- a/src/Essentials/src/Contacts/Contacts.shared.cs +++ b/src/Essentials/src/Contacts/Contacts.shared.cs @@ -52,7 +52,11 @@ public static Task> GetAllAsync(CancellationToken cancellat public static IContacts Default => defaultImplementation ??= new ContactsImplementation(); - internal static void SetDefault(IContacts? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IContacts? implementation) => defaultImplementation = implementation; } } diff --git a/src/Essentials/src/Email/Email.shared.cs b/src/Essentials/src/Email/Email.shared.cs index d443f610f742..3679b1b69626 100644 --- a/src/Essentials/src/Email/Email.shared.cs +++ b/src/Essentials/src/Email/Email.shared.cs @@ -123,7 +123,11 @@ public static Task ComposeAsync(EmailMessage message) => public static IEmail Default => defaultImplementation ??= new EmailImplementation(); - internal static void SetDefault(IEmail? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IEmail? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/FilePicker/FilePicker.shared.cs b/src/Essentials/src/FilePicker/FilePicker.shared.cs index 3bd50798f3b9..63569f6aa326 100644 --- a/src/Essentials/src/FilePicker/FilePicker.shared.cs +++ b/src/Essentials/src/FilePicker/FilePicker.shared.cs @@ -88,7 +88,11 @@ public static partial class FilePicker public static IFilePicker Default => defaultImplementation ??= new FilePickerImplementation(); - internal static void SetDefault(IFilePicker? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IFilePicker? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Flashlight/Flashlight.shared.cs b/src/Essentials/src/Flashlight/Flashlight.shared.cs index addb5a3b10fa..444b16cda4e8 100644 --- a/src/Essentials/src/Flashlight/Flashlight.shared.cs +++ b/src/Essentials/src/Flashlight/Flashlight.shared.cs @@ -60,7 +60,11 @@ public static Task TurnOffAsync() => public static IFlashlight Default => defaultImplementation ??= new FlashlightImplementation(); - internal static void SetDefault(IFlashlight? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IFlashlight? implementation) => defaultImplementation = implementation; } } diff --git a/src/Essentials/src/Geocoding/Geocoding.shared.cs b/src/Essentials/src/Geocoding/Geocoding.shared.cs index 6c09d5576d59..0aae56bca5d0 100644 --- a/src/Essentials/src/Geocoding/Geocoding.shared.cs +++ b/src/Essentials/src/Geocoding/Geocoding.shared.cs @@ -80,7 +80,11 @@ public static Task> GetLocationsAsync(string address) => public static IGeocoding Default => defaultImplementation ??= new GeocodingImplementation(); - internal static void SetCurrent(IGeocoding? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IGeocoding? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Geolocation/Geolocation.shared.cs b/src/Essentials/src/Geolocation/Geolocation.shared.cs index 0f101dc25216..489906bcbba2 100644 --- a/src/Essentials/src/Geolocation/Geolocation.shared.cs +++ b/src/Essentials/src/Geolocation/Geolocation.shared.cs @@ -176,7 +176,11 @@ public static void StopListeningForeground() => public static IGeolocation Default => defaultImplementation ??= new GeolocationImplementation(); - internal static void SetDefault(IGeolocation? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IGeolocation? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Gyroscope/Gyroscope.shared.cs b/src/Essentials/src/Gyroscope/Gyroscope.shared.cs index 59244468478c..2950709df22c 100644 --- a/src/Essentials/src/Gyroscope/Gyroscope.shared.cs +++ b/src/Essentials/src/Gyroscope/Gyroscope.shared.cs @@ -86,7 +86,11 @@ public static void Stop() public static IGyroscope Default => defaultImplementation ??= new GyroscopeImplementation(); - internal static void SetDefault(IGyroscope? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IGyroscope? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/HapticFeedback/HapticFeedback.shared.cs b/src/Essentials/src/HapticFeedback/HapticFeedback.shared.cs index 4744e1e727e7..d50c3f39786f 100644 --- a/src/Essentials/src/HapticFeedback/HapticFeedback.shared.cs +++ b/src/Essentials/src/HapticFeedback/HapticFeedback.shared.cs @@ -47,7 +47,11 @@ public static bool IsSupported public static IHapticFeedback Default => defaultImplementation ??= new HapticFeedbackImplementation(); - internal static void SetDefault(IHapticFeedback? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IHapticFeedback? implementation) => defaultImplementation = implementation; } } diff --git a/src/Essentials/src/Launcher/Launcher.shared.cs b/src/Essentials/src/Launcher/Launcher.shared.cs index c70f27690e40..072882648fa9 100644 --- a/src/Essentials/src/Launcher/Launcher.shared.cs +++ b/src/Essentials/src/Launcher/Launcher.shared.cs @@ -130,7 +130,11 @@ public static Task TryOpenAsync(Uri uri) public static ILauncher Default => defaultImplementation ??= new LauncherImplementation(); - internal static void SetDefault(ILauncher? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(ILauncher? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Magnetometer/Magnetometer.shared.cs b/src/Essentials/src/Magnetometer/Magnetometer.shared.cs index 5c0d65d3107c..92ec75397932 100644 --- a/src/Essentials/src/Magnetometer/Magnetometer.shared.cs +++ b/src/Essentials/src/Magnetometer/Magnetometer.shared.cs @@ -90,7 +90,11 @@ public static void Stop() public static IMagnetometer Default => defaultImplementation ??= new MagnetometerImplementation(); - internal static void SetDefault(IMagnetometer? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IMagnetometer? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Map/Map.shared.cs b/src/Essentials/src/Map/Map.shared.cs index 6f2b682c2385..8e1cd4ffcfcb 100644 --- a/src/Essentials/src/Map/Map.shared.cs +++ b/src/Essentials/src/Map/Map.shared.cs @@ -174,7 +174,11 @@ public static Task TryOpenAsync(Placemark placemark, MapLaunchOptions opti public static IMap Default => defaultImplementation ??= new MapImplementation(); - internal static void SetDefault(IMap? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IMap? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/MediaPicker/MediaPicker.shared.cs b/src/Essentials/src/MediaPicker/MediaPicker.shared.cs index 279184fd5037..b4550b9d2ffe 100644 --- a/src/Essentials/src/MediaPicker/MediaPicker.shared.cs +++ b/src/Essentials/src/MediaPicker/MediaPicker.shared.cs @@ -136,7 +136,11 @@ public static Task> PickVideosAsync(MediaPickerOptions? options public static IMediaPicker Default => defaultImplementation ??= new MediaPickerImplementation(); - internal static void SetDefault(IMediaPicker? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IMediaPicker? implementation) => defaultImplementation = implementation; } /// diff --git a/src/Essentials/src/OrientationSensor/OrientationSensor.shared.cs b/src/Essentials/src/OrientationSensor/OrientationSensor.shared.cs index c0d16fea5dab..edbe39dbf6bf 100644 --- a/src/Essentials/src/OrientationSensor/OrientationSensor.shared.cs +++ b/src/Essentials/src/OrientationSensor/OrientationSensor.shared.cs @@ -89,7 +89,11 @@ public static void Stop() public static IOrientationSensor Default => defaultImplementation ??= new OrientationSensorImplementation(); - internal static void SetDefault(IOrientationSensor? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IOrientationSensor? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/PhoneDialer/PhoneDialer.shared.cs b/src/Essentials/src/PhoneDialer/PhoneDialer.shared.cs index 47cf6541640f..777609019ff2 100644 --- a/src/Essentials/src/PhoneDialer/PhoneDialer.shared.cs +++ b/src/Essentials/src/PhoneDialer/PhoneDialer.shared.cs @@ -58,7 +58,11 @@ public static void Open(string number) public static IPhoneDialer Default => defaultImplementation ??= new PhoneDialerImplementation(); - internal static void SetDefault(IPhoneDialer? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IPhoneDialer? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Platform/ActivityStateManager.android.cs b/src/Essentials/src/Platform/ActivityStateManager.android.cs index a66a1f2d7007..340be622cb6c 100644 --- a/src/Essentials/src/Platform/ActivityStateManager.android.cs +++ b/src/Essentials/src/Platform/ActivityStateManager.android.cs @@ -59,7 +59,11 @@ public static class ActivityStateManager public static IActivityStateManager Default => defaultImplementation ??= new ActivityStateManagerImplementation(); - internal static void SetDefault(IActivityStateManager? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IActivityStateManager? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Platform/WindowStateManager.ios.cs b/src/Essentials/src/Platform/WindowStateManager.ios.cs index b58463d97a05..6eaa34b4176d 100644 --- a/src/Essentials/src/Platform/WindowStateManager.ios.cs +++ b/src/Essentials/src/Platform/WindowStateManager.ios.cs @@ -42,7 +42,11 @@ public static class WindowStateManager public static IWindowStateManager Default => defaultImplementation ??= new WindowStateManagerImplementation(); - internal static void SetDefault(IWindowStateManager? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IWindowStateManager? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Platform/windowstateManager.windows.cs b/src/Essentials/src/Platform/windowstateManager.windows.cs index d045e92d6407..7989f64c0e48 100644 --- a/src/Essentials/src/Platform/windowstateManager.windows.cs +++ b/src/Essentials/src/Platform/windowstateManager.windows.cs @@ -48,7 +48,11 @@ public static class WindowStateManager public static IWindowStateManager Default => defaultImplementation ??= new WindowStateManagerImplementation(); - internal static void SetDefault(IWindowStateManager? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IWindowStateManager? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Preferences/Preferences.shared.cs b/src/Essentials/src/Preferences/Preferences.shared.cs index 189b956ae4c7..e4e7231b1eb7 100644 --- a/src/Essentials/src/Preferences/Preferences.shared.cs +++ b/src/Essentials/src/Preferences/Preferences.shared.cs @@ -267,7 +267,11 @@ internal static string GetPrivatePreferencesSharedName(string feature) => public static IPreferences Default => defaultImplementation ??= new PreferencesImplementation(); - internal static void SetDefault(IPreferences? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IPreferences? implementation) => defaultImplementation = implementation; internal static Type[] SupportedTypes = new Type[] diff --git a/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt index c85f863d2957..537cf3d66c01 100644 --- a/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -1,5 +1,37 @@ #nullable enable *REMOVED*Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! -Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! *REMOVED*static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! +Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Accessibility.SemanticScreenReader.SetDefault(Microsoft.Maui.Accessibility.ISemanticScreenReader? implementation) -> void +static Microsoft.Maui.ApplicationModel.ActivityStateManager.SetDefault(Microsoft.Maui.ApplicationModel.IActivityStateManager? implementation) -> void +static Microsoft.Maui.ApplicationModel.Browser.SetDefault(Microsoft.Maui.ApplicationModel.IBrowser? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Contacts.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IContacts? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Email.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IEmail? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Sms.SetDefault(Microsoft.Maui.ApplicationModel.Communication.ISms? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Clipboard.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IClipboard? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Share.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IShare? implementation) -> void +static Microsoft.Maui.ApplicationModel.Launcher.SetDefault(Microsoft.Maui.ApplicationModel.ILauncher? implementation) -> void +static Microsoft.Maui.ApplicationModel.Map.SetDefault(Microsoft.Maui.ApplicationModel.IMap? implementation) -> void +static Microsoft.Maui.ApplicationModel.VersionTracking.SetDefault(Microsoft.Maui.ApplicationModel.IVersionTracking? implementation) -> void +static Microsoft.Maui.Authentication.AppleSignInAuthenticator.SetDefault(Microsoft.Maui.Authentication.IAppleSignInAuthenticator? implementation) -> void +static Microsoft.Maui.Authentication.WebAuthenticator.SetDefault(Microsoft.Maui.Authentication.IWebAuthenticator? implementation) -> void +static Microsoft.Maui.Devices.Battery.SetDefault(Microsoft.Maui.Devices.IBattery? implementation) -> void +static Microsoft.Maui.Devices.Flashlight.SetDefault(Microsoft.Maui.Devices.IFlashlight? implementation) -> void +static Microsoft.Maui.Devices.HapticFeedback.SetDefault(Microsoft.Maui.Devices.IHapticFeedback? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Accelerometer.SetDefault(Microsoft.Maui.Devices.Sensors.IAccelerometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Barometer.SetDefault(Microsoft.Maui.Devices.Sensors.IBarometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Compass.SetDefault(Microsoft.Maui.Devices.Sensors.ICompass? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geocoding.SetDefault(Microsoft.Maui.Devices.Sensors.IGeocoding? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geolocation.SetDefault(Microsoft.Maui.Devices.Sensors.IGeolocation? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Gyroscope.SetDefault(Microsoft.Maui.Devices.Sensors.IGyroscope? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Magnetometer.SetDefault(Microsoft.Maui.Devices.Sensors.IMagnetometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.OrientationSensor.SetDefault(Microsoft.Maui.Devices.Sensors.IOrientationSensor? implementation) -> void +static Microsoft.Maui.Devices.Vibration.SetDefault(Microsoft.Maui.Devices.IVibration? implementation) -> void +static Microsoft.Maui.Media.MediaPicker.SetDefault(Microsoft.Maui.Media.IMediaPicker? implementation) -> void +static Microsoft.Maui.Media.Screenshot.SetDefault(Microsoft.Maui.Media.IScreenshot? implementation) -> void +static Microsoft.Maui.Media.TextToSpeech.SetDefault(Microsoft.Maui.Media.ITextToSpeech? implementation) -> void static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Storage.FilePicker.SetDefault(Microsoft.Maui.Storage.IFilePicker? implementation) -> void +static Microsoft.Maui.Storage.Preferences.SetDefault(Microsoft.Maui.Storage.IPreferences? implementation) -> void +static Microsoft.Maui.Storage.SecureStorage.SetDefault(Microsoft.Maui.Storage.ISecureStorage? implementation) -> void diff --git a/src/Essentials/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt index c85f863d2957..e9fb3487ec5b 100644 --- a/src/Essentials/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -1,5 +1,37 @@ #nullable enable *REMOVED*Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! -Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! *REMOVED*static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! +Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Accessibility.SemanticScreenReader.SetDefault(Microsoft.Maui.Accessibility.ISemanticScreenReader? implementation) -> void +static Microsoft.Maui.ApplicationModel.Browser.SetDefault(Microsoft.Maui.ApplicationModel.IBrowser? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Contacts.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IContacts? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Email.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IEmail? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Sms.SetDefault(Microsoft.Maui.ApplicationModel.Communication.ISms? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Clipboard.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IClipboard? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Share.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IShare? implementation) -> void +static Microsoft.Maui.ApplicationModel.Launcher.SetDefault(Microsoft.Maui.ApplicationModel.ILauncher? implementation) -> void +static Microsoft.Maui.ApplicationModel.Map.SetDefault(Microsoft.Maui.ApplicationModel.IMap? implementation) -> void +static Microsoft.Maui.ApplicationModel.VersionTracking.SetDefault(Microsoft.Maui.ApplicationModel.IVersionTracking? implementation) -> void +static Microsoft.Maui.ApplicationModel.WindowStateManager.SetDefault(Microsoft.Maui.ApplicationModel.IWindowStateManager? implementation) -> void +static Microsoft.Maui.Authentication.AppleSignInAuthenticator.SetDefault(Microsoft.Maui.Authentication.IAppleSignInAuthenticator? implementation) -> void +static Microsoft.Maui.Authentication.WebAuthenticator.SetDefault(Microsoft.Maui.Authentication.IWebAuthenticator? implementation) -> void +static Microsoft.Maui.Devices.Battery.SetDefault(Microsoft.Maui.Devices.IBattery? implementation) -> void +static Microsoft.Maui.Devices.Flashlight.SetDefault(Microsoft.Maui.Devices.IFlashlight? implementation) -> void +static Microsoft.Maui.Devices.HapticFeedback.SetDefault(Microsoft.Maui.Devices.IHapticFeedback? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Accelerometer.SetDefault(Microsoft.Maui.Devices.Sensors.IAccelerometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Barometer.SetDefault(Microsoft.Maui.Devices.Sensors.IBarometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Compass.SetDefault(Microsoft.Maui.Devices.Sensors.ICompass? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geocoding.SetDefault(Microsoft.Maui.Devices.Sensors.IGeocoding? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geolocation.SetDefault(Microsoft.Maui.Devices.Sensors.IGeolocation? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Gyroscope.SetDefault(Microsoft.Maui.Devices.Sensors.IGyroscope? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Magnetometer.SetDefault(Microsoft.Maui.Devices.Sensors.IMagnetometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.OrientationSensor.SetDefault(Microsoft.Maui.Devices.Sensors.IOrientationSensor? implementation) -> void +static Microsoft.Maui.Devices.Vibration.SetDefault(Microsoft.Maui.Devices.IVibration? implementation) -> void +static Microsoft.Maui.Media.MediaPicker.SetDefault(Microsoft.Maui.Media.IMediaPicker? implementation) -> void +static Microsoft.Maui.Media.Screenshot.SetDefault(Microsoft.Maui.Media.IScreenshot? implementation) -> void +static Microsoft.Maui.Media.TextToSpeech.SetDefault(Microsoft.Maui.Media.ITextToSpeech? implementation) -> void static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Storage.FilePicker.SetDefault(Microsoft.Maui.Storage.IFilePicker? implementation) -> void +static Microsoft.Maui.Storage.Preferences.SetDefault(Microsoft.Maui.Storage.IPreferences? implementation) -> void +static Microsoft.Maui.Storage.SecureStorage.SetDefault(Microsoft.Maui.Storage.ISecureStorage? implementation) -> void diff --git a/src/Essentials/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index c85f863d2957..e9fb3487ec5b 100644 --- a/src/Essentials/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -1,5 +1,37 @@ #nullable enable *REMOVED*Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! -Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! *REMOVED*static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! +Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Accessibility.SemanticScreenReader.SetDefault(Microsoft.Maui.Accessibility.ISemanticScreenReader? implementation) -> void +static Microsoft.Maui.ApplicationModel.Browser.SetDefault(Microsoft.Maui.ApplicationModel.IBrowser? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Contacts.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IContacts? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Email.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IEmail? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Sms.SetDefault(Microsoft.Maui.ApplicationModel.Communication.ISms? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Clipboard.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IClipboard? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Share.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IShare? implementation) -> void +static Microsoft.Maui.ApplicationModel.Launcher.SetDefault(Microsoft.Maui.ApplicationModel.ILauncher? implementation) -> void +static Microsoft.Maui.ApplicationModel.Map.SetDefault(Microsoft.Maui.ApplicationModel.IMap? implementation) -> void +static Microsoft.Maui.ApplicationModel.VersionTracking.SetDefault(Microsoft.Maui.ApplicationModel.IVersionTracking? implementation) -> void +static Microsoft.Maui.ApplicationModel.WindowStateManager.SetDefault(Microsoft.Maui.ApplicationModel.IWindowStateManager? implementation) -> void +static Microsoft.Maui.Authentication.AppleSignInAuthenticator.SetDefault(Microsoft.Maui.Authentication.IAppleSignInAuthenticator? implementation) -> void +static Microsoft.Maui.Authentication.WebAuthenticator.SetDefault(Microsoft.Maui.Authentication.IWebAuthenticator? implementation) -> void +static Microsoft.Maui.Devices.Battery.SetDefault(Microsoft.Maui.Devices.IBattery? implementation) -> void +static Microsoft.Maui.Devices.Flashlight.SetDefault(Microsoft.Maui.Devices.IFlashlight? implementation) -> void +static Microsoft.Maui.Devices.HapticFeedback.SetDefault(Microsoft.Maui.Devices.IHapticFeedback? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Accelerometer.SetDefault(Microsoft.Maui.Devices.Sensors.IAccelerometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Barometer.SetDefault(Microsoft.Maui.Devices.Sensors.IBarometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Compass.SetDefault(Microsoft.Maui.Devices.Sensors.ICompass? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geocoding.SetDefault(Microsoft.Maui.Devices.Sensors.IGeocoding? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geolocation.SetDefault(Microsoft.Maui.Devices.Sensors.IGeolocation? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Gyroscope.SetDefault(Microsoft.Maui.Devices.Sensors.IGyroscope? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Magnetometer.SetDefault(Microsoft.Maui.Devices.Sensors.IMagnetometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.OrientationSensor.SetDefault(Microsoft.Maui.Devices.Sensors.IOrientationSensor? implementation) -> void +static Microsoft.Maui.Devices.Vibration.SetDefault(Microsoft.Maui.Devices.IVibration? implementation) -> void +static Microsoft.Maui.Media.MediaPicker.SetDefault(Microsoft.Maui.Media.IMediaPicker? implementation) -> void +static Microsoft.Maui.Media.Screenshot.SetDefault(Microsoft.Maui.Media.IScreenshot? implementation) -> void +static Microsoft.Maui.Media.TextToSpeech.SetDefault(Microsoft.Maui.Media.ITextToSpeech? implementation) -> void static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Storage.FilePicker.SetDefault(Microsoft.Maui.Storage.IFilePicker? implementation) -> void +static Microsoft.Maui.Storage.Preferences.SetDefault(Microsoft.Maui.Storage.IPreferences? implementation) -> void +static Microsoft.Maui.Storage.SecureStorage.SetDefault(Microsoft.Maui.Storage.ISecureStorage? implementation) -> void diff --git a/src/Essentials/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt index c85f863d2957..af9d838fde27 100644 --- a/src/Essentials/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt @@ -1,5 +1,36 @@ #nullable enable *REMOVED*Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! -Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! *REMOVED*static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! +Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Accessibility.SemanticScreenReader.SetDefault(Microsoft.Maui.Accessibility.ISemanticScreenReader? implementation) -> void +static Microsoft.Maui.ApplicationModel.Browser.SetDefault(Microsoft.Maui.ApplicationModel.IBrowser? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Contacts.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IContacts? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Email.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IEmail? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Sms.SetDefault(Microsoft.Maui.ApplicationModel.Communication.ISms? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Clipboard.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IClipboard? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Share.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IShare? implementation) -> void +static Microsoft.Maui.ApplicationModel.Launcher.SetDefault(Microsoft.Maui.ApplicationModel.ILauncher? implementation) -> void +static Microsoft.Maui.ApplicationModel.Map.SetDefault(Microsoft.Maui.ApplicationModel.IMap? implementation) -> void +static Microsoft.Maui.ApplicationModel.VersionTracking.SetDefault(Microsoft.Maui.ApplicationModel.IVersionTracking? implementation) -> void +static Microsoft.Maui.Authentication.AppleSignInAuthenticator.SetDefault(Microsoft.Maui.Authentication.IAppleSignInAuthenticator? implementation) -> void +static Microsoft.Maui.Authentication.WebAuthenticator.SetDefault(Microsoft.Maui.Authentication.IWebAuthenticator? implementation) -> void +static Microsoft.Maui.Devices.Battery.SetDefault(Microsoft.Maui.Devices.IBattery? implementation) -> void +static Microsoft.Maui.Devices.Flashlight.SetDefault(Microsoft.Maui.Devices.IFlashlight? implementation) -> void +static Microsoft.Maui.Devices.HapticFeedback.SetDefault(Microsoft.Maui.Devices.IHapticFeedback? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Accelerometer.SetDefault(Microsoft.Maui.Devices.Sensors.IAccelerometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Barometer.SetDefault(Microsoft.Maui.Devices.Sensors.IBarometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Compass.SetDefault(Microsoft.Maui.Devices.Sensors.ICompass? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geocoding.SetDefault(Microsoft.Maui.Devices.Sensors.IGeocoding? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geolocation.SetDefault(Microsoft.Maui.Devices.Sensors.IGeolocation? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Gyroscope.SetDefault(Microsoft.Maui.Devices.Sensors.IGyroscope? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Magnetometer.SetDefault(Microsoft.Maui.Devices.Sensors.IMagnetometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.OrientationSensor.SetDefault(Microsoft.Maui.Devices.Sensors.IOrientationSensor? implementation) -> void +static Microsoft.Maui.Devices.Vibration.SetDefault(Microsoft.Maui.Devices.IVibration? implementation) -> void +static Microsoft.Maui.Media.MediaPicker.SetDefault(Microsoft.Maui.Media.IMediaPicker? implementation) -> void +static Microsoft.Maui.Media.Screenshot.SetDefault(Microsoft.Maui.Media.IScreenshot? implementation) -> void +static Microsoft.Maui.Media.TextToSpeech.SetDefault(Microsoft.Maui.Media.ITextToSpeech? implementation) -> void static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Storage.FilePicker.SetDefault(Microsoft.Maui.Storage.IFilePicker? implementation) -> void +static Microsoft.Maui.Storage.Preferences.SetDefault(Microsoft.Maui.Storage.IPreferences? implementation) -> void +static Microsoft.Maui.Storage.SecureStorage.SetDefault(Microsoft.Maui.Storage.ISecureStorage? implementation) -> void diff --git a/src/Essentials/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt index c85f863d2957..e9fb3487ec5b 100644 --- a/src/Essentials/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt @@ -1,5 +1,37 @@ #nullable enable *REMOVED*Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! -Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! *REMOVED*static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! +Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Accessibility.SemanticScreenReader.SetDefault(Microsoft.Maui.Accessibility.ISemanticScreenReader? implementation) -> void +static Microsoft.Maui.ApplicationModel.Browser.SetDefault(Microsoft.Maui.ApplicationModel.IBrowser? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Contacts.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IContacts? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Email.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IEmail? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Sms.SetDefault(Microsoft.Maui.ApplicationModel.Communication.ISms? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Clipboard.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IClipboard? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Share.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IShare? implementation) -> void +static Microsoft.Maui.ApplicationModel.Launcher.SetDefault(Microsoft.Maui.ApplicationModel.ILauncher? implementation) -> void +static Microsoft.Maui.ApplicationModel.Map.SetDefault(Microsoft.Maui.ApplicationModel.IMap? implementation) -> void +static Microsoft.Maui.ApplicationModel.VersionTracking.SetDefault(Microsoft.Maui.ApplicationModel.IVersionTracking? implementation) -> void +static Microsoft.Maui.ApplicationModel.WindowStateManager.SetDefault(Microsoft.Maui.ApplicationModel.IWindowStateManager? implementation) -> void +static Microsoft.Maui.Authentication.AppleSignInAuthenticator.SetDefault(Microsoft.Maui.Authentication.IAppleSignInAuthenticator? implementation) -> void +static Microsoft.Maui.Authentication.WebAuthenticator.SetDefault(Microsoft.Maui.Authentication.IWebAuthenticator? implementation) -> void +static Microsoft.Maui.Devices.Battery.SetDefault(Microsoft.Maui.Devices.IBattery? implementation) -> void +static Microsoft.Maui.Devices.Flashlight.SetDefault(Microsoft.Maui.Devices.IFlashlight? implementation) -> void +static Microsoft.Maui.Devices.HapticFeedback.SetDefault(Microsoft.Maui.Devices.IHapticFeedback? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Accelerometer.SetDefault(Microsoft.Maui.Devices.Sensors.IAccelerometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Barometer.SetDefault(Microsoft.Maui.Devices.Sensors.IBarometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Compass.SetDefault(Microsoft.Maui.Devices.Sensors.ICompass? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geocoding.SetDefault(Microsoft.Maui.Devices.Sensors.IGeocoding? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geolocation.SetDefault(Microsoft.Maui.Devices.Sensors.IGeolocation? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Gyroscope.SetDefault(Microsoft.Maui.Devices.Sensors.IGyroscope? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Magnetometer.SetDefault(Microsoft.Maui.Devices.Sensors.IMagnetometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.OrientationSensor.SetDefault(Microsoft.Maui.Devices.Sensors.IOrientationSensor? implementation) -> void +static Microsoft.Maui.Devices.Vibration.SetDefault(Microsoft.Maui.Devices.IVibration? implementation) -> void +static Microsoft.Maui.Media.MediaPicker.SetDefault(Microsoft.Maui.Media.IMediaPicker? implementation) -> void +static Microsoft.Maui.Media.Screenshot.SetDefault(Microsoft.Maui.Media.IScreenshot? implementation) -> void +static Microsoft.Maui.Media.TextToSpeech.SetDefault(Microsoft.Maui.Media.ITextToSpeech? implementation) -> void static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Storage.FilePicker.SetDefault(Microsoft.Maui.Storage.IFilePicker? implementation) -> void +static Microsoft.Maui.Storage.Preferences.SetDefault(Microsoft.Maui.Storage.IPreferences? implementation) -> void +static Microsoft.Maui.Storage.SecureStorage.SetDefault(Microsoft.Maui.Storage.ISecureStorage? implementation) -> void diff --git a/src/Essentials/src/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net/PublicAPI.Unshipped.txt index c85f863d2957..af9d838fde27 100644 --- a/src/Essentials/src/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net/PublicAPI.Unshipped.txt @@ -1,5 +1,36 @@ #nullable enable *REMOVED*Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! -Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! *REMOVED*static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! +Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Accessibility.SemanticScreenReader.SetDefault(Microsoft.Maui.Accessibility.ISemanticScreenReader? implementation) -> void +static Microsoft.Maui.ApplicationModel.Browser.SetDefault(Microsoft.Maui.ApplicationModel.IBrowser? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Contacts.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IContacts? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Email.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IEmail? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Sms.SetDefault(Microsoft.Maui.ApplicationModel.Communication.ISms? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Clipboard.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IClipboard? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Share.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IShare? implementation) -> void +static Microsoft.Maui.ApplicationModel.Launcher.SetDefault(Microsoft.Maui.ApplicationModel.ILauncher? implementation) -> void +static Microsoft.Maui.ApplicationModel.Map.SetDefault(Microsoft.Maui.ApplicationModel.IMap? implementation) -> void +static Microsoft.Maui.ApplicationModel.VersionTracking.SetDefault(Microsoft.Maui.ApplicationModel.IVersionTracking? implementation) -> void +static Microsoft.Maui.Authentication.AppleSignInAuthenticator.SetDefault(Microsoft.Maui.Authentication.IAppleSignInAuthenticator? implementation) -> void +static Microsoft.Maui.Authentication.WebAuthenticator.SetDefault(Microsoft.Maui.Authentication.IWebAuthenticator? implementation) -> void +static Microsoft.Maui.Devices.Battery.SetDefault(Microsoft.Maui.Devices.IBattery? implementation) -> void +static Microsoft.Maui.Devices.Flashlight.SetDefault(Microsoft.Maui.Devices.IFlashlight? implementation) -> void +static Microsoft.Maui.Devices.HapticFeedback.SetDefault(Microsoft.Maui.Devices.IHapticFeedback? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Accelerometer.SetDefault(Microsoft.Maui.Devices.Sensors.IAccelerometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Barometer.SetDefault(Microsoft.Maui.Devices.Sensors.IBarometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Compass.SetDefault(Microsoft.Maui.Devices.Sensors.ICompass? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geocoding.SetDefault(Microsoft.Maui.Devices.Sensors.IGeocoding? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geolocation.SetDefault(Microsoft.Maui.Devices.Sensors.IGeolocation? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Gyroscope.SetDefault(Microsoft.Maui.Devices.Sensors.IGyroscope? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Magnetometer.SetDefault(Microsoft.Maui.Devices.Sensors.IMagnetometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.OrientationSensor.SetDefault(Microsoft.Maui.Devices.Sensors.IOrientationSensor? implementation) -> void +static Microsoft.Maui.Devices.Vibration.SetDefault(Microsoft.Maui.Devices.IVibration? implementation) -> void +static Microsoft.Maui.Media.MediaPicker.SetDefault(Microsoft.Maui.Media.IMediaPicker? implementation) -> void +static Microsoft.Maui.Media.Screenshot.SetDefault(Microsoft.Maui.Media.IScreenshot? implementation) -> void +static Microsoft.Maui.Media.TextToSpeech.SetDefault(Microsoft.Maui.Media.ITextToSpeech? implementation) -> void static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Storage.FilePicker.SetDefault(Microsoft.Maui.Storage.IFilePicker? implementation) -> void +static Microsoft.Maui.Storage.Preferences.SetDefault(Microsoft.Maui.Storage.IPreferences? implementation) -> void +static Microsoft.Maui.Storage.SecureStorage.SetDefault(Microsoft.Maui.Storage.ISecureStorage? implementation) -> void diff --git a/src/Essentials/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt index c85f863d2957..af9d838fde27 100644 --- a/src/Essentials/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -1,5 +1,36 @@ #nullable enable *REMOVED*Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! -Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! *REMOVED*static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task!>! +Microsoft.Maui.Storage.IFilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Accessibility.SemanticScreenReader.SetDefault(Microsoft.Maui.Accessibility.ISemanticScreenReader? implementation) -> void +static Microsoft.Maui.ApplicationModel.Browser.SetDefault(Microsoft.Maui.ApplicationModel.IBrowser? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Contacts.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IContacts? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Email.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IEmail? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.SetDefault(Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer? implementation) -> void +static Microsoft.Maui.ApplicationModel.Communication.Sms.SetDefault(Microsoft.Maui.ApplicationModel.Communication.ISms? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Clipboard.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IClipboard? implementation) -> void +static Microsoft.Maui.ApplicationModel.DataTransfer.Share.SetDefault(Microsoft.Maui.ApplicationModel.DataTransfer.IShare? implementation) -> void +static Microsoft.Maui.ApplicationModel.Launcher.SetDefault(Microsoft.Maui.ApplicationModel.ILauncher? implementation) -> void +static Microsoft.Maui.ApplicationModel.Map.SetDefault(Microsoft.Maui.ApplicationModel.IMap? implementation) -> void +static Microsoft.Maui.ApplicationModel.VersionTracking.SetDefault(Microsoft.Maui.ApplicationModel.IVersionTracking? implementation) -> void +static Microsoft.Maui.Authentication.AppleSignInAuthenticator.SetDefault(Microsoft.Maui.Authentication.IAppleSignInAuthenticator? implementation) -> void +static Microsoft.Maui.Authentication.WebAuthenticator.SetDefault(Microsoft.Maui.Authentication.IWebAuthenticator? implementation) -> void +static Microsoft.Maui.Devices.Battery.SetDefault(Microsoft.Maui.Devices.IBattery? implementation) -> void +static Microsoft.Maui.Devices.Flashlight.SetDefault(Microsoft.Maui.Devices.IFlashlight? implementation) -> void +static Microsoft.Maui.Devices.HapticFeedback.SetDefault(Microsoft.Maui.Devices.IHapticFeedback? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Accelerometer.SetDefault(Microsoft.Maui.Devices.Sensors.IAccelerometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Barometer.SetDefault(Microsoft.Maui.Devices.Sensors.IBarometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Compass.SetDefault(Microsoft.Maui.Devices.Sensors.ICompass? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geocoding.SetDefault(Microsoft.Maui.Devices.Sensors.IGeocoding? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Geolocation.SetDefault(Microsoft.Maui.Devices.Sensors.IGeolocation? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Gyroscope.SetDefault(Microsoft.Maui.Devices.Sensors.IGyroscope? implementation) -> void +static Microsoft.Maui.Devices.Sensors.Magnetometer.SetDefault(Microsoft.Maui.Devices.Sensors.IMagnetometer? implementation) -> void +static Microsoft.Maui.Devices.Sensors.OrientationSensor.SetDefault(Microsoft.Maui.Devices.Sensors.IOrientationSensor? implementation) -> void +static Microsoft.Maui.Devices.Vibration.SetDefault(Microsoft.Maui.Devices.IVibration? implementation) -> void +static Microsoft.Maui.Media.MediaPicker.SetDefault(Microsoft.Maui.Media.IMediaPicker? implementation) -> void +static Microsoft.Maui.Media.Screenshot.SetDefault(Microsoft.Maui.Media.IScreenshot? implementation) -> void +static Microsoft.Maui.Media.TextToSpeech.SetDefault(Microsoft.Maui.Media.ITextToSpeech? implementation) -> void static Microsoft.Maui.Storage.FilePicker.PickMultipleAsync(Microsoft.Maui.Storage.PickOptions? options = null) -> System.Threading.Tasks.Task?>! +static Microsoft.Maui.Storage.FilePicker.SetDefault(Microsoft.Maui.Storage.IFilePicker? implementation) -> void +static Microsoft.Maui.Storage.Preferences.SetDefault(Microsoft.Maui.Storage.IPreferences? implementation) -> void +static Microsoft.Maui.Storage.SecureStorage.SetDefault(Microsoft.Maui.Storage.ISecureStorage? implementation) -> void diff --git a/src/Essentials/src/Screenshot/Screenshot.shared.cs b/src/Essentials/src/Screenshot/Screenshot.shared.cs index 129cf8296f4d..014a414d33c0 100644 --- a/src/Essentials/src/Screenshot/Screenshot.shared.cs +++ b/src/Essentials/src/Screenshot/Screenshot.shared.cs @@ -165,7 +165,11 @@ public static Task CaptureAsync() public static IScreenshot Default => defaultImplementation ??= new ScreenshotImplementation(); - internal static void SetDefault(IScreenshot? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IScreenshot? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/SecureStorage/SecureStorage.shared.cs b/src/Essentials/src/SecureStorage/SecureStorage.shared.cs index 5fb793ab8b0f..6d6765496197 100644 --- a/src/Essentials/src/SecureStorage/SecureStorage.shared.cs +++ b/src/Essentials/src/SecureStorage/SecureStorage.shared.cs @@ -141,7 +141,11 @@ public static Task SetAsync(string key, string value, Security.SecAccessible acc public static ISecureStorage Default => defaultImplementation ??= new SecureStorageImplementation(); - internal static void SetDefault(ISecureStorage? implementation) + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(ISecureStorage? implementation) { defaultImplementation = implementation; } diff --git a/src/Essentials/src/SemanticScreenReader/SemanticScreenReader.shared.cs b/src/Essentials/src/SemanticScreenReader/SemanticScreenReader.shared.cs index 89195b8f6932..2b48a5cf4ce9 100644 --- a/src/Essentials/src/SemanticScreenReader/SemanticScreenReader.shared.cs +++ b/src/Essentials/src/SemanticScreenReader/SemanticScreenReader.shared.cs @@ -38,7 +38,11 @@ public static void Announce(string text) public static ISemanticScreenReader Default => defaultImplementation ??= new SemanticScreenReaderImplementation(); - internal static void SetDefault(ISemanticScreenReader? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(ISemanticScreenReader? implementation) => defaultImplementation = implementation; } } diff --git a/src/Essentials/src/Share/Share.shared.cs b/src/Essentials/src/Share/Share.shared.cs index 5c322c2fdb43..9fd00397b0a5 100644 --- a/src/Essentials/src/Share/Share.shared.cs +++ b/src/Essentials/src/Share/Share.shared.cs @@ -91,7 +91,11 @@ public static Task RequestAsync(ShareMultipleFilesRequest request) => public static IShare Default => defaultImplementation ??= new ShareImplementation(); - internal static void SetDefault(IShare? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IShare? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/Sms/Sms.shared.cs b/src/Essentials/src/Sms/Sms.shared.cs index c719f4fda509..c333aea80328 100644 --- a/src/Essentials/src/Sms/Sms.shared.cs +++ b/src/Essentials/src/Sms/Sms.shared.cs @@ -54,7 +54,11 @@ public static Task ComposeAsync(SmsMessage? message) public static ISms Default => defaultImplementation ??= new SmsImplementation(); - internal static void SetDefault(ISms? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(ISms? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/TextToSpeech/TextToSpeech.shared.cs b/src/Essentials/src/TextToSpeech/TextToSpeech.shared.cs index 522cc74351c8..dbdf270b772d 100644 --- a/src/Essentials/src/TextToSpeech/TextToSpeech.shared.cs +++ b/src/Essentials/src/TextToSpeech/TextToSpeech.shared.cs @@ -68,7 +68,11 @@ public static Task SpeakAsync(string text, SpeechOptions? options, CancellationT public static ITextToSpeech Default => defaultImplementation ??= new TextToSpeechImplementation(); - internal static void SetDefault(ITextToSpeech? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(ITextToSpeech? implementation) => defaultImplementation = implementation; internal static List SplitSpeak(string text, int max) diff --git a/src/Essentials/src/VersionTracking/VersionTracking.shared.cs b/src/Essentials/src/VersionTracking/VersionTracking.shared.cs index c2a8dc5591ea..d0abe87a7a68 100644 --- a/src/Essentials/src/VersionTracking/VersionTracking.shared.cs +++ b/src/Essentials/src/VersionTracking/VersionTracking.shared.cs @@ -188,7 +188,11 @@ public static bool IsFirstLaunchForBuild(string build) public static IVersionTracking Default => defaultImplementation ??= new VersionTrackingImplementation(Preferences.Default, AppInfo.Current); - internal static void SetDefault(IVersionTracking? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IVersionTracking? implementation) => defaultImplementation = implementation; internal static void InitVersionTracking() => diff --git a/src/Essentials/src/Vibration/Vibration.shared.cs b/src/Essentials/src/Vibration/Vibration.shared.cs index 4800ffed7355..387ed8eb2d0e 100644 --- a/src/Essentials/src/Vibration/Vibration.shared.cs +++ b/src/Essentials/src/Vibration/Vibration.shared.cs @@ -82,7 +82,11 @@ public static bool IsSupported public static IVibration Default => defaultImplementation ??= new VibrationImplementation(); - internal static void SetDefault(IVibration? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IVibration? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/WebAuthenticator/AppleSignInAuthenticator.shared.cs b/src/Essentials/src/WebAuthenticator/AppleSignInAuthenticator.shared.cs index 858c02fc400a..e150aa492c74 100644 --- a/src/Essentials/src/WebAuthenticator/AppleSignInAuthenticator.shared.cs +++ b/src/Essentials/src/WebAuthenticator/AppleSignInAuthenticator.shared.cs @@ -38,7 +38,11 @@ public static Task AuthenticateAsync(AppleSignInAuthenti public static IAppleSignInAuthenticator Default => defaultImplementation ??= new AppleSignInAuthenticatorImplementation(); - internal static void SetDefault(IAppleSignInAuthenticator? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IAppleSignInAuthenticator? implementation) => defaultImplementation = implementation; /// diff --git a/src/Essentials/src/WebAuthenticator/WebAuthenticator.shared.cs b/src/Essentials/src/WebAuthenticator/WebAuthenticator.shared.cs index 6b256deb6c6e..56efe062ef85 100644 --- a/src/Essentials/src/WebAuthenticator/WebAuthenticator.shared.cs +++ b/src/Essentials/src/WebAuthenticator/WebAuthenticator.shared.cs @@ -139,7 +139,11 @@ public static Task AuthenticateAsync(WebAuthenticatorOpt public static IWebAuthenticator Default => defaultImplementation ??= new WebAuthenticatorImplementation(); - internal static void SetDefault(IWebAuthenticator? implementation) => + /// + /// Sets the default implementation of this API that is exposed as the static property. + /// + /// An instance that implements the API, or to reset to the platform default. + public static void SetDefault(IWebAuthenticator? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/test/UnitTests/SetDefault_Tests.cs b/src/Essentials/test/UnitTests/SetDefault_Tests.cs new file mode 100644 index 000000000000..57333914d34c --- /dev/null +++ b/src/Essentials/test/UnitTests/SetDefault_Tests.cs @@ -0,0 +1,200 @@ +#nullable enable +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; +using Microsoft.Maui.Devices.Sensors; +using Microsoft.Maui.Storage; +using Xunit; + +namespace Tests +{ + [CollectionDefinition("SetDefault", DisableParallelization = true)] + public class SetDefaultCollection + { + } + + [Collection("SetDefault")] + public class SetDefault_Tests + { + [Fact] + public void AllEssentialsTypes_ExposePublicSetDefault() + { + var essentialsAssembly = typeof(Preferences).Assembly; + var missingSetDefaultMethods = new List(); + + var typesWithInterfaceDefault = essentialsAssembly + .GetTypes() + .Where(t => t.IsClass && t.IsAbstract && t.IsSealed) + .Where(t => t.Namespace?.StartsWith("Microsoft.Maui.", StringComparison.Ordinal) == true) + .Select(t => new + { + Type = t, + DefaultProperty = t.GetProperty("Default", BindingFlags.Public | BindingFlags.Static), + }) + .Where(x => + x.DefaultProperty is not null && + x.DefaultProperty.PropertyType.IsInterface && + x.DefaultProperty.GetMethod?.IsPublic == true) + .OrderBy(x => x.Type.FullName, StringComparer.Ordinal); + + foreach (var entry in typesWithInterfaceDefault) + { + var setDefaultMethod = entry.Type.GetMethod( + "SetDefault", + BindingFlags.Public | BindingFlags.Static, + binder: null, + types: new[] { entry.DefaultProperty!.PropertyType }, + modifiers: null); + + if (setDefaultMethod is null || setDefaultMethod.ReturnType != typeof(void)) + { + missingSetDefaultMethods.Add($"{entry.Type.FullName}.SetDefault({entry.DefaultProperty!.PropertyType.FullName})"); + } + } + + Assert.True( + missingSetDefaultMethods.Count == 0, + "Missing or invalid public static SetDefault methods:\n" + string.Join("\n", missingSetDefaultMethods)); + } + + // --- Geocoding SetDefault tests --- + + [Fact] + public void Geocoding_SetDefault_SetsCustomImplementation() + { + var custom = new MockGeocoding(); + try + { + Geocoding.SetDefault(custom); + Assert.Same(custom, Geocoding.Default); + } + finally + { + Geocoding.SetDefault(null); + } + } + + [Fact] + public void Geocoding_SetDefault_Null_ResetsToDefault() + { + var custom = new MockGeocoding(); + Geocoding.SetDefault(custom); + Geocoding.SetDefault(null); + + // After reset, Default should return a new platform default (not our mock) + Assert.NotSame(custom, Geocoding.Default); + } + + [Fact] + public async Task Geocoding_SetDefault_CustomImplementation_IsUsed() + { + var custom = new MockGeocoding(); + try + { + Geocoding.SetDefault(custom); + var results = await Geocoding.GetLocationsAsync("test address"); + Assert.Empty(results); + Assert.True(custom.GetLocationsCalled); + } + finally + { + Geocoding.SetDefault(null); + } + } + + // --- Preferences SetDefault tests --- + + [Fact] + public void Preferences_SetDefault_SetsCustomImplementation() + { + var custom = new MockPreferences(); + try + { + Preferences.SetDefault(custom); + Assert.Same(custom, Preferences.Default); + } + finally + { + Preferences.SetDefault(null); + } + } + + [Fact] + public void Preferences_SetDefault_Null_ResetsToDefault() + { + var custom = new MockPreferences(); + Preferences.SetDefault(custom); + Preferences.SetDefault(null); + + Assert.NotSame(custom, Preferences.Default); + } + + // --- FilePicker SetDefault tests --- + + [Fact] + public void FilePicker_SetDefault_SetsCustomImplementation() + { + var custom = new MockFilePicker(); + try + { + FilePicker.SetDefault(custom); + Assert.Same(custom, FilePicker.Default); + } + finally + { + FilePicker.SetDefault(null); + } + } + + [Fact] + public void FilePicker_SetDefault_Null_ResetsToDefault() + { + var custom = new MockFilePicker(); + FilePicker.SetDefault(custom); + FilePicker.SetDefault(null); + + Assert.NotSame(custom, FilePicker.Default); + } + + // --- Mock implementations --- + + class MockGeocoding : IGeocoding + { + public bool GetLocationsCalled { get; private set; } + + public Task> GetPlacemarksAsync(double latitude, double longitude) + => Task.FromResult>(Array.Empty()); + + public Task> GetLocationsAsync(string address) + { + GetLocationsCalled = true; + return Task.FromResult>(Array.Empty()); + } + } + + class MockPreferences : IPreferences + { + public bool ContainsKey(string key) => false; + public bool ContainsKey(string key, string? sharedName) => false; + public void Remove(string key) { } + public void Remove(string key, string? sharedName) { } + public void Clear() { } + public void Clear(string? sharedName) { } + public void Set(string key, T value) { } + public void Set(string key, T value, string? sharedName) { } + public T Get(string key, T defaultValue) => defaultValue; + public T Get(string key, T defaultValue, string? sharedName) => defaultValue; + } + + class MockFilePicker : IFilePicker + { + public Task PickAsync(PickOptions? options = null) + => Task.FromResult(null); + + public Task?> PickMultipleAsync(PickOptions? options = null) + => Task.FromResult?>(Array.Empty()); + } + } +}