diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props
index 7649181f7..583de6897 100644
--- a/src/Directory.Packages.props
+++ b/src/Directory.Packages.props
@@ -17,10 +17,10 @@
-
-
+
+
-
+
@@ -33,7 +33,7 @@
-
+
@@ -43,6 +43,7 @@
+
@@ -53,6 +54,7 @@
+
@@ -62,9 +64,9 @@
-
+
-
+
@@ -80,4 +82,4 @@
-
+
\ No newline at end of file
diff --git a/src/Directory.build.props b/src/Directory.build.props
index 1229755d4..e2a6f25a6 100644
--- a/src/Directory.build.props
+++ b/src/Directory.build.props
@@ -1,7 +1,7 @@
true
- $(NoWarn);1591;1701;1702;1705;VSX1000
+ $(NoWarn);1591;1701;1702;1705;VSX1000;IDE0130
AnyCPU
$(MSBuildProjectName.Contains('Tests'))
embedded
@@ -14,7 +14,7 @@
A library to make things cross-platform that should be.
true
anaisbetts;ghuntley
- drawing;colours;geometry;logging;unit test detection;service location;image handling;portable;xamarin;xamarin ios;xamarin mac;android;monodroid;uwp;net45
+ drawing;colours;geometry;logging;unit test detection;service location;image handling;portable;xamarin;xamarin ios;xamarin mac;android
https://github.com/reactiveui/splat/releases
https://github.com/reactiveui/splat
git
@@ -37,8 +37,8 @@
true
$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb
- netstandard2.0;net6.0;net8.0
- net6.0-windows10.0.17763.0;net8.0-windows10.0.17763.0
+ netstandard2.0;net8.0;net9.0
+ net8.0-windows10.0.17763.0;net9.0-windows10.0.17763.0
false
diff --git a/src/Directory.build.targets b/src/Directory.build.targets
index 8c0765f72..133baaa24 100644
--- a/src/Directory.build.targets
+++ b/src/Directory.build.targets
@@ -25,7 +25,7 @@
$(DefineConstants);MONO;ANDROID
-
+
$(DefineConstants);IS_SHARED_NET
diff --git a/src/ReactiveUI.DI.Tests/ReactiveUI.DI.Tests.csproj b/src/ReactiveUI.DI.Tests/ReactiveUI.DI.Tests.csproj
index ce3c829e5..11afd7322 100644
--- a/src/ReactiveUI.DI.Tests/ReactiveUI.DI.Tests.csproj
+++ b/src/ReactiveUI.DI.Tests/ReactiveUI.DI.Tests.csproj
@@ -1,6 +1,6 @@
- net472;net8.0;
+ net472;net8.0;net9.0
$(NoWarn);1591;CA1707;SA1633;CA2000
false
enable
@@ -14,7 +14,7 @@
-
+
diff --git a/src/Splat.Autofac.Tests/Splat.Autofac.Tests.csproj b/src/Splat.Autofac.Tests/Splat.Autofac.Tests.csproj
index 19944b356..5ee558ff0 100644
--- a/src/Splat.Autofac.Tests/Splat.Autofac.Tests.csproj
+++ b/src/Splat.Autofac.Tests/Splat.Autofac.Tests.csproj
@@ -1,13 +1,17 @@
- net8.0-windows10.0.17763.0
+ net8.0-windows10.0.17763.0;net9.0-windows10.0.17763.0
false
$(NoWarn);1591;CA1707;SA1633;CA2000;CA1851
enable
+
+
+
+
diff --git a/src/Splat.Autofac/AutofacDependencyResolver.cs b/src/Splat.Autofac/AutofacDependencyResolver.cs
index bc4c7c9ff..dcfbc6184 100644
--- a/src/Splat.Autofac/AutofacDependencyResolver.cs
+++ b/src/Splat.Autofac/AutofacDependencyResolver.cs
@@ -255,14 +255,9 @@ protected virtual void Dispose(bool disposing)
var lifeTimeScope = _lifetimeScope ?? _internalLifetimeScope;
- if (contract is null || string.IsNullOrWhiteSpace(contract))
- {
- lifeTimeScope.TryResolve(serviceType, out serviceInstance!);
- }
- else
- {
- lifeTimeScope.TryResolveNamed(contract, serviceType, out serviceInstance!);
- }
+ _ = contract is null || string.IsNullOrWhiteSpace(contract)
+ ? lifeTimeScope.TryResolve(serviceType, out serviceInstance!)
+ : lifeTimeScope.TryResolveNamed(contract, serviceType, out serviceInstance!);
return serviceInstance;
}
diff --git a/src/Splat.Avalonia.Autofac/AvaloniaMixins.cs b/src/Splat.Avalonia.Autofac/AvaloniaMixins.cs
index 6612729a5..085fdb94d 100644
--- a/src/Splat.Avalonia.Autofac/AvaloniaMixins.cs
+++ b/src/Splat.Avalonia.Autofac/AvaloniaMixins.cs
@@ -110,7 +110,7 @@ public static AppBuilder UseReactiveUIWithDIContainer(
#endif
var container = containerFactory();
- Locator.CurrentMutable.RegisterConstant(container, typeof(TContainer));
+ Locator.CurrentMutable.RegisterConstant(container);
var dependencyResolver = dependencyResolverFactory(container);
Locator.SetLocator(dependencyResolver);
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
diff --git a/src/Splat.Avalonia.Autofac/Splat.Avalonia.Autofac.csproj b/src/Splat.Avalonia.Autofac/Splat.Avalonia.Autofac.csproj
index c9672c272..977c68c10 100644
--- a/src/Splat.Avalonia.Autofac/Splat.Avalonia.Autofac.csproj
+++ b/src/Splat.Avalonia.Autofac/Splat.Avalonia.Autofac.csproj
@@ -10,6 +10,7 @@
+
\ No newline at end of file
diff --git a/src/Splat.Avalonia.DryIoc/AvaloniaMixins.cs b/src/Splat.Avalonia.DryIoc/AvaloniaMixins.cs
index a6970e448..6fc04d02c 100644
--- a/src/Splat.Avalonia.DryIoc/AvaloniaMixins.cs
+++ b/src/Splat.Avalonia.DryIoc/AvaloniaMixins.cs
@@ -42,7 +42,7 @@ public static AppBuilder UseReactiveUIWithDryIoc(this AppBuilder builder, Action
#endif
var container = new Container();
- Locator.CurrentMutable.RegisterConstant(container, typeof(Container));
+ Locator.CurrentMutable.RegisterConstant(container);
Locator.SetLocator(new DryIocDependencyResolver(container));
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
containerConfig(container);
@@ -98,7 +98,7 @@ public static AppBuilder UseReactiveUIWithDIContainer(
#endif
var container = containerFactory();
- Locator.CurrentMutable.RegisterConstant(container, typeof(TContainer));
+ Locator.CurrentMutable.RegisterConstant(container);
var dependencyResolver = dependencyResolverFactory(container);
Locator.SetLocator(dependencyResolver);
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
diff --git a/src/Splat.Avalonia.DryIoc/Splat.Avalonia.DryIoc.csproj b/src/Splat.Avalonia.DryIoc/Splat.Avalonia.DryIoc.csproj
index fff888195..671d66ed5 100644
--- a/src/Splat.Avalonia.DryIoc/Splat.Avalonia.DryIoc.csproj
+++ b/src/Splat.Avalonia.DryIoc/Splat.Avalonia.DryIoc.csproj
@@ -10,6 +10,7 @@
+
\ No newline at end of file
diff --git a/src/Splat.Avalonia.DryIoc1.Tests/Splat.Avalonia.DryIoc1.Tests.csproj b/src/Splat.Avalonia.DryIoc1.Tests/Splat.Avalonia.DryIoc1.Tests.csproj
index ff5efd36b..4d941632b 100644
--- a/src/Splat.Avalonia.DryIoc1.Tests/Splat.Avalonia.DryIoc1.Tests.csproj
+++ b/src/Splat.Avalonia.DryIoc1.Tests/Splat.Avalonia.DryIoc1.Tests.csproj
@@ -1,6 +1,6 @@
-
+
- net6.0
+ net8.0;net9.0
enable
enable
$(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000
diff --git a/src/Splat.Avalonia.DryIoc2.Tests/Splat.Avalonia.DryIoc2.Tests.csproj b/src/Splat.Avalonia.DryIoc2.Tests/Splat.Avalonia.DryIoc2.Tests.csproj
index 2ac5bc52f..1b4852ded 100644
--- a/src/Splat.Avalonia.DryIoc2.Tests/Splat.Avalonia.DryIoc2.Tests.csproj
+++ b/src/Splat.Avalonia.DryIoc2.Tests/Splat.Avalonia.DryIoc2.Tests.csproj
@@ -1,6 +1,6 @@
- net8.0
+ net8.0;net9.0
enable
enable
$(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000
diff --git a/src/Splat.Avalonia.Microsoft.Extensions.DependencyInjection/AvaloniaMixins.cs b/src/Splat.Avalonia.Microsoft.Extensions.DependencyInjection/AvaloniaMixins.cs
index 2431c7df1..370cf9e0b 100644
--- a/src/Splat.Avalonia.Microsoft.Extensions.DependencyInjection/AvaloniaMixins.cs
+++ b/src/Splat.Avalonia.Microsoft.Extensions.DependencyInjection/AvaloniaMixins.cs
@@ -44,7 +44,7 @@ public static AppBuilder UseReactiveUIWithMicrosoftDependencyResolver(this AppBu
#endif
IServiceCollection serviceCollection = new ServiceCollection();
- Locator.CurrentMutable.RegisterConstant(serviceCollection, typeof(IServiceCollection));
+ Locator.CurrentMutable.RegisterConstant(serviceCollection);
Locator.SetLocator(new MicrosoftDependencyResolver(serviceCollection));
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
containerConfig(serviceCollection);
@@ -114,7 +114,7 @@ public static AppBuilder UseReactiveUIWithDIContainer(
#endif
var container = containerFactory();
- Locator.CurrentMutable.RegisterConstant(container, typeof(TContainer));
+ Locator.CurrentMutable.RegisterConstant(container);
var dependencyResolver = dependencyResolverFactory(container);
Locator.SetLocator(dependencyResolver);
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
diff --git a/src/Splat.Avalonia.Microsoft.Extensions.DependencyInjection/Splat.Avalonia.Microsoft.Extensions.DependencyInjection.csproj b/src/Splat.Avalonia.Microsoft.Extensions.DependencyInjection/Splat.Avalonia.Microsoft.Extensions.DependencyInjection.csproj
index 2ca7ec4db..f2964edd5 100644
--- a/src/Splat.Avalonia.Microsoft.Extensions.DependencyInjection/Splat.Avalonia.Microsoft.Extensions.DependencyInjection.csproj
+++ b/src/Splat.Avalonia.Microsoft.Extensions.DependencyInjection/Splat.Avalonia.Microsoft.Extensions.DependencyInjection.csproj
@@ -10,6 +10,7 @@
+
\ No newline at end of file
diff --git a/src/Splat.Avalonia.Microsoft1.Tests/Splat.Avalonia.Microsoft1.Tests.csproj b/src/Splat.Avalonia.Microsoft1.Tests/Splat.Avalonia.Microsoft1.Tests.csproj
index eeb39bfd5..d91114cdd 100644
--- a/src/Splat.Avalonia.Microsoft1.Tests/Splat.Avalonia.Microsoft1.Tests.csproj
+++ b/src/Splat.Avalonia.Microsoft1.Tests/Splat.Avalonia.Microsoft1.Tests.csproj
@@ -1,6 +1,6 @@
-
+
- net6.0
+ net8.0;net9.0
enable
enable
$(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000
diff --git a/src/Splat.Avalonia.Microsoft2.Tests/Splat.Avalonia.Microsoft2.Tests.csproj b/src/Splat.Avalonia.Microsoft2.Tests/Splat.Avalonia.Microsoft2.Tests.csproj
index 53de45431..9add5b3a5 100644
--- a/src/Splat.Avalonia.Microsoft2.Tests/Splat.Avalonia.Microsoft2.Tests.csproj
+++ b/src/Splat.Avalonia.Microsoft2.Tests/Splat.Avalonia.Microsoft2.Tests.csproj
@@ -1,6 +1,6 @@
- net8.0
+ net8.0;net9.0
enable
enable
$(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000
diff --git a/src/Splat.Avalonia.Ninject/AvaloniaMixins.cs b/src/Splat.Avalonia.Ninject/AvaloniaMixins.cs
index 58ca0d9c2..b7aaa3986 100644
--- a/src/Splat.Avalonia.Ninject/AvaloniaMixins.cs
+++ b/src/Splat.Avalonia.Ninject/AvaloniaMixins.cs
@@ -42,7 +42,7 @@ public static AppBuilder UseReactiveUIWithNinject(this AppBuilder builder, Actio
#endif
var container = new StandardKernel();
- Locator.CurrentMutable.RegisterConstant(container, typeof(StandardKernel));
+ Locator.CurrentMutable.RegisterConstant(container);
Locator.SetLocator(new NinjectDependencyResolver(container));
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
containerConfig(container);
@@ -98,7 +98,7 @@ public static AppBuilder UseReactiveUIWithDIContainer(
#endif
var container = containerFactory();
- Locator.CurrentMutable.RegisterConstant(container, typeof(TContainer));
+ Locator.CurrentMutable.RegisterConstant(container);
var dependencyResolver = dependencyResolverFactory(container);
Locator.SetLocator(dependencyResolver);
RxApp.MainThreadScheduler = AvaloniaScheduler.Instance;
diff --git a/src/Splat.Avalonia.Ninject/Splat.Avalonia.Ninject.csproj b/src/Splat.Avalonia.Ninject/Splat.Avalonia.Ninject.csproj
index b39ec95bb..507aec1fc 100644
--- a/src/Splat.Avalonia.Ninject/Splat.Avalonia.Ninject.csproj
+++ b/src/Splat.Avalonia.Ninject/Splat.Avalonia.Ninject.csproj
@@ -10,6 +10,7 @@
+
\ No newline at end of file
diff --git a/src/Splat.Avalonia.Tests/Splat.Avalonia.Tests.csproj b/src/Splat.Avalonia.Tests/Splat.Avalonia.Tests.csproj
index 5ab40cc8c..0a04e2730 100644
--- a/src/Splat.Avalonia.Tests/Splat.Avalonia.Tests.csproj
+++ b/src/Splat.Avalonia.Tests/Splat.Avalonia.Tests.csproj
@@ -1,6 +1,6 @@
- net6.0;net8.0
+ net8.0;net9.0
enable
enable
$(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000
diff --git a/src/Splat.Common.Test/Splat.Common.Test.csproj b/src/Splat.Common.Test/Splat.Common.Test.csproj
index c207ccd34..65983484c 100644
--- a/src/Splat.Common.Test/Splat.Common.Test.csproj
+++ b/src/Splat.Common.Test/Splat.Common.Test.csproj
@@ -1,7 +1,7 @@
- netstandard2.0;net8.0
+ netstandard2.0;net8.0;net9.0
$(NoWarn);CA2000
enable
diff --git a/src/Splat.Drawing.Tests/API/ApiApprovalTests.SplatUIProject.DotNet9_0.verified.txt b/src/Splat.Drawing.Tests/API/ApiApprovalTests.SplatUIProject.DotNet9_0.verified.txt
new file mode 100644
index 000000000..400ee13a0
--- /dev/null
+++ b/src/Splat.Drawing.Tests/API/ApiApprovalTests.SplatUIProject.DotNet9_0.verified.txt
@@ -0,0 +1,449 @@
+[assembly: System.Resources.NeutralResourcesLanguage("en-US")]
+[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.Drawing.Tests")]
+[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.TestRunner.Android")]
+[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.TestRunner.Uwp")]
+[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.Tests")]
+[assembly: System.Runtime.Versioning.SupportedOSPlatform("Windows10.0.17763.0")]
+[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v9.0", FrameworkDisplayName=".NET 9.0")]
+[assembly: System.Runtime.Versioning.TargetPlatform("Windows10.0.17763.0")]
+namespace Splat
+{
+ public static class BitmapLoader
+ {
+ public static Splat.IBitmapLoader Current { get; set; }
+ }
+ [System.Serializable]
+ public class BitmapLoaderException : System.Exception
+ {
+ public BitmapLoaderException() { }
+ public BitmapLoaderException(string message) { }
+ public BitmapLoaderException(string message, System.Exception innerException) { }
+ }
+ public static class BitmapMixins
+ {
+ public static Splat.IBitmap FromNative(this System.Windows.Media.Imaging.BitmapSource value) { }
+ public static System.Windows.Media.Imaging.BitmapSource ToNative(this Splat.IBitmap value) { }
+ }
+ public static class ColorExtensions
+ {
+ public static System.Drawing.Color FromNative(this System.Windows.Media.Color value) { }
+ public static System.Windows.Media.Color ToNative(this System.Drawing.Color value) { }
+ public static System.Windows.Media.SolidColorBrush ToNativeBrush(this System.Drawing.Color value) { }
+ }
+ public enum CompressedBitmapFormat
+ {
+ Png = 0,
+ Jpeg = 1,
+ }
+ public class DefaultPlatformModeDetector : Splat.IPlatformModeDetector
+ {
+ public DefaultPlatformModeDetector() { }
+ public bool? InDesignMode() { }
+ }
+ public interface IBitmap : System.IDisposable
+ {
+ float Height { get; }
+ float Width { get; }
+ System.Threading.Tasks.Task Save(Splat.CompressedBitmapFormat format, float quality, System.IO.Stream target);
+ }
+ public interface IBitmapLoader
+ {
+ Splat.IBitmap? Create(float width, float height);
+ System.Threading.Tasks.Task Load(System.IO.Stream sourceStream, float? desiredWidth, float? desiredHeight);
+ System.Threading.Tasks.Task LoadFromResource(string source, float? desiredWidth, float? desiredHeight);
+ }
+ public interface IPlatformModeDetector
+ {
+ bool? InDesignMode();
+ }
+ public enum KnownColor
+ {
+ Empty = 0,
+ ActiveBorder = 1,
+ ActiveCaption = 2,
+ ActiveCaptionText = 3,
+ AppWorkspace = 4,
+ Control = 5,
+ ControlDark = 6,
+ ControlDarkDark = 7,
+ ControlLight = 8,
+ ControlLightLight = 9,
+ ControlText = 10,
+ Desktop = 11,
+ GrayText = 12,
+ Highlight = 13,
+ HighlightText = 14,
+ HotTrack = 15,
+ InactiveBorder = 16,
+ InactiveCaption = 17,
+ InactiveCaptionText = 18,
+ Info = 19,
+ InfoText = 20,
+ Menu = 21,
+ MenuText = 22,
+ ScrollBar = 23,
+ Window = 24,
+ WindowFrame = 25,
+ WindowText = 26,
+ Transparent = 27,
+ AliceBlue = 28,
+ AntiqueWhite = 29,
+ Aqua = 30,
+ Aquamarine = 31,
+ Azure = 32,
+ Beige = 33,
+ Bisque = 34,
+ Black = 35,
+ BlanchedAlmond = 36,
+ Blue = 37,
+ BlueViolet = 38,
+ Brown = 39,
+ BurlyWood = 40,
+ CadetBlue = 41,
+ Chartreuse = 42,
+ Chocolate = 43,
+ Coral = 44,
+ CornflowerBlue = 45,
+ Cornsilk = 46,
+ Crimson = 47,
+ Cyan = 48,
+ DarkBlue = 49,
+ DarkCyan = 50,
+ DarkGoldenrod = 51,
+ DarkGray = 52,
+ DarkGreen = 53,
+ DarkKhaki = 54,
+ DarkMagenta = 55,
+ DarkOliveGreen = 56,
+ DarkOrange = 57,
+ DarkOrchid = 58,
+ DarkRed = 59,
+ DarkSalmon = 60,
+ DarkSeaGreen = 61,
+ DarkSlateBlue = 62,
+ DarkSlateGray = 63,
+ DarkTurquoise = 64,
+ DarkViolet = 65,
+ DeepPink = 66,
+ DeepSkyBlue = 67,
+ DimGray = 68,
+ DodgerBlue = 69,
+ Firebrick = 70,
+ FloralWhite = 71,
+ ForestGreen = 72,
+ Fuchsia = 73,
+ Gainsboro = 74,
+ GhostWhite = 75,
+ Gold = 76,
+ Goldenrod = 77,
+ Gray = 78,
+ Green = 79,
+ GreenYellow = 80,
+ Honeydew = 81,
+ HotPink = 82,
+ IndianRed = 83,
+ Indigo = 84,
+ Ivory = 85,
+ Khaki = 86,
+ Lavender = 87,
+ LavenderBlush = 88,
+ LawnGreen = 89,
+ LemonChiffon = 90,
+ LightBlue = 91,
+ LightCoral = 92,
+ LightCyan = 93,
+ LightGoldenrodYellow = 94,
+ LightGray = 95,
+ LightGreen = 96,
+ LightPink = 97,
+ LightSalmon = 98,
+ LightSeaGreen = 99,
+ LightSkyBlue = 100,
+ LightSlateGray = 101,
+ LightSteelBlue = 102,
+ LightYellow = 103,
+ Lime = 104,
+ LimeGreen = 105,
+ Linen = 106,
+ Magenta = 107,
+ Maroon = 108,
+ MediumAquamarine = 109,
+ MediumBlue = 110,
+ MediumOrchid = 111,
+ MediumPurple = 112,
+ MediumSeaGreen = 113,
+ MediumSlateBlue = 114,
+ MediumSpringGreen = 115,
+ MediumTurquoise = 116,
+ MediumVioletRed = 117,
+ MidnightBlue = 118,
+ MintCream = 119,
+ MistyRose = 120,
+ Moccasin = 121,
+ NavajoWhite = 122,
+ Navy = 123,
+ OldLace = 124,
+ Olive = 125,
+ OliveDrab = 126,
+ Orange = 127,
+ OrangeRed = 128,
+ Orchid = 129,
+ PaleGoldenrod = 130,
+ PaleGreen = 131,
+ PaleTurquoise = 132,
+ PaleVioletRed = 133,
+ PapayaWhip = 134,
+ PeachPuff = 135,
+ Peru = 136,
+ Pink = 137,
+ Plum = 138,
+ PowderBlue = 139,
+ Purple = 140,
+ Red = 141,
+ RosyBrown = 142,
+ RoyalBlue = 143,
+ SaddleBrown = 144,
+ Salmon = 145,
+ SandyBrown = 146,
+ SeaGreen = 147,
+ SeaShell = 148,
+ Sienna = 149,
+ Silver = 150,
+ SkyBlue = 151,
+ SlateBlue = 152,
+ SlateGray = 153,
+ Snow = 154,
+ SpringGreen = 155,
+ SteelBlue = 156,
+ Tan = 157,
+ Teal = 158,
+ Thistle = 159,
+ Tomato = 160,
+ Turquoise = 161,
+ Violet = 162,
+ Wheat = 163,
+ White = 164,
+ WhiteSmoke = 165,
+ Yellow = 166,
+ YellowGreen = 167,
+ ButtonFace = 168,
+ ButtonHighlight = 169,
+ ButtonShadow = 170,
+ GradientActiveCaption = 171,
+ GradientInactiveCaption = 172,
+ MenuBar = 173,
+ MenuHighlight = 174,
+ }
+ public class PlatformBitmapLoader : Splat.IBitmapLoader
+ {
+ public PlatformBitmapLoader() { }
+ public Splat.IBitmap Create(float width, float height) { }
+ public System.Threading.Tasks.Task Load(System.IO.Stream sourceStream, float? desiredWidth, float? desiredHeight) { }
+ public System.Threading.Tasks.Task LoadFromResource(string source, float? desiredWidth, float? desiredHeight) { }
+ }
+ public static class PlatformModeDetector
+ {
+ public static bool InDesignMode() { }
+ public static void OverrideModeDetector(Splat.IPlatformModeDetector modeDetector) { }
+ }
+ public static class PointExtensions
+ {
+ public static System.Drawing.PointF FromNative(this System.Windows.Point value) { }
+ public static System.Windows.Point ToNative(this System.Drawing.Point value) { }
+ public static System.Windows.Point ToNative(this System.Drawing.PointF value) { }
+ }
+ public static class RectExtensions
+ {
+ public static System.Drawing.RectangleF FromNative(this System.Windows.Rect value) { }
+ public static System.Windows.Rect ToNative(this System.Drawing.Rectangle value) { }
+ public static System.Windows.Rect ToNative(this System.Drawing.RectangleF value) { }
+ }
+ public static class ServiceLocationDrawingInitialization
+ {
+ public static void RegisterPlatformBitmapLoader(this Splat.IMutableDependencyResolver resolver) { }
+ }
+ public static class SizeExtensions
+ {
+ public static System.Drawing.SizeF FromNative(this System.Windows.Size value) { }
+ public static System.Windows.Size ToNative(this System.Drawing.Size value) { }
+ public static System.Windows.Size ToNative(this System.Drawing.SizeF value) { }
+ }
+ [System.Runtime.Serialization.DataContract]
+ public struct SplatColor : System.IEquatable
+ {
+ public byte A { get; }
+ public byte B { get; }
+ public byte G { get; }
+ public bool IsEmpty { get; }
+ public bool IsKnownColor { get; }
+ public bool IsNamedColor { get; }
+ public bool IsSystemColor { get; }
+ public string Name { get; }
+ public byte R { get; }
+ public static Splat.SplatColor AliceBlue { get; }
+ public static Splat.SplatColor AntiqueWhite { get; }
+ public static Splat.SplatColor Aqua { get; }
+ public static Splat.SplatColor Aquamarine { get; }
+ public static Splat.SplatColor Azure { get; }
+ public static Splat.SplatColor Beige { get; }
+ public static Splat.SplatColor Bisque { get; }
+ public static Splat.SplatColor Black { get; }
+ public static Splat.SplatColor BlanchedAlmond { get; }
+ public static Splat.SplatColor Blue { get; }
+ public static Splat.SplatColor BlueViolet { get; }
+ public static Splat.SplatColor Brown { get; }
+ public static Splat.SplatColor BurlyWood { get; }
+ public static Splat.SplatColor CadetBlue { get; }
+ public static Splat.SplatColor Chartreuse { get; }
+ public static Splat.SplatColor Chocolate { get; }
+ public static Splat.SplatColor Coral { get; }
+ public static Splat.SplatColor CornflowerBlue { get; }
+ public static Splat.SplatColor Cornsilk { get; }
+ public static Splat.SplatColor Crimson { get; }
+ public static Splat.SplatColor Cyan { get; }
+ public static Splat.SplatColor DarkBlue { get; }
+ public static Splat.SplatColor DarkCyan { get; }
+ public static Splat.SplatColor DarkGoldenrod { get; }
+ public static Splat.SplatColor DarkGray { get; }
+ public static Splat.SplatColor DarkGreen { get; }
+ public static Splat.SplatColor DarkKhaki { get; }
+ public static Splat.SplatColor DarkMagenta { get; }
+ public static Splat.SplatColor DarkOliveGreen { get; }
+ public static Splat.SplatColor DarkOrange { get; }
+ public static Splat.SplatColor DarkOrchid { get; }
+ public static Splat.SplatColor DarkRed { get; }
+ public static Splat.SplatColor DarkSalmon { get; }
+ public static Splat.SplatColor DarkSeaGreen { get; }
+ public static Splat.SplatColor DarkSlateBlue { get; }
+ public static Splat.SplatColor DarkSlateGray { get; }
+ public static Splat.SplatColor DarkTurquoise { get; }
+ public static Splat.SplatColor DarkViolet { get; }
+ public static Splat.SplatColor DeepPink { get; }
+ public static Splat.SplatColor DeepSkyBlue { get; }
+ public static Splat.SplatColor DimGray { get; }
+ public static Splat.SplatColor DodgerBlue { get; }
+ public static Splat.SplatColor Empty { get; }
+ public static Splat.SplatColor Firebrick { get; }
+ public static Splat.SplatColor FloralWhite { get; }
+ public static Splat.SplatColor ForestGreen { get; }
+ public static Splat.SplatColor Fuchsia { get; }
+ public static Splat.SplatColor Gainsboro { get; }
+ public static Splat.SplatColor GhostWhite { get; }
+ public static Splat.SplatColor Gold { get; }
+ public static Splat.SplatColor Goldenrod { get; }
+ public static Splat.SplatColor Gray { get; }
+ public static Splat.SplatColor Green { get; }
+ public static Splat.SplatColor GreenYellow { get; }
+ public static Splat.SplatColor Honeydew { get; }
+ public static Splat.SplatColor HotPink { get; }
+ public static Splat.SplatColor IndianRed { get; }
+ public static Splat.SplatColor Indigo { get; }
+ public static Splat.SplatColor Ivory { get; }
+ public static Splat.SplatColor Khaki { get; }
+ public static Splat.SplatColor Lavender { get; }
+ public static Splat.SplatColor LavenderBlush { get; }
+ public static Splat.SplatColor LawnGreen { get; }
+ public static Splat.SplatColor LemonChiffon { get; }
+ public static Splat.SplatColor LightBlue { get; }
+ public static Splat.SplatColor LightCoral { get; }
+ public static Splat.SplatColor LightCyan { get; }
+ public static Splat.SplatColor LightGoldenrodYellow { get; }
+ public static Splat.SplatColor LightGray { get; }
+ public static Splat.SplatColor LightGreen { get; }
+ public static Splat.SplatColor LightPink { get; }
+ public static Splat.SplatColor LightSalmon { get; }
+ public static Splat.SplatColor LightSeaGreen { get; }
+ public static Splat.SplatColor LightSkyBlue { get; }
+ public static Splat.SplatColor LightSlateGray { get; }
+ public static Splat.SplatColor LightSteelBlue { get; }
+ public static Splat.SplatColor LightYellow { get; }
+ public static Splat.SplatColor Lime { get; }
+ public static Splat.SplatColor LimeGreen { get; }
+ public static Splat.SplatColor Linen { get; }
+ public static Splat.SplatColor Magenta { get; }
+ public static Splat.SplatColor Maroon { get; }
+ public static Splat.SplatColor MediumAquamarine { get; }
+ public static Splat.SplatColor MediumBlue { get; }
+ public static Splat.SplatColor MediumOrchid { get; }
+ public static Splat.SplatColor MediumPurple { get; }
+ public static Splat.SplatColor MediumSeaGreen { get; }
+ public static Splat.SplatColor MediumSlateBlue { get; }
+ public static Splat.SplatColor MediumSpringGreen { get; }
+ public static Splat.SplatColor MediumTurquoise { get; }
+ public static Splat.SplatColor MediumVioletRed { get; }
+ public static Splat.SplatColor MidnightBlue { get; }
+ public static Splat.SplatColor MintCream { get; }
+ public static Splat.SplatColor MistyRose { get; }
+ public static Splat.SplatColor Moccasin { get; }
+ public static Splat.SplatColor NavajoWhite { get; }
+ public static Splat.SplatColor Navy { get; }
+ public static Splat.SplatColor OldLace { get; }
+ public static Splat.SplatColor Olive { get; }
+ public static Splat.SplatColor OliveDrab { get; }
+ public static Splat.SplatColor Orange { get; }
+ public static Splat.SplatColor OrangeRed { get; }
+ public static Splat.SplatColor Orchid { get; }
+ public static Splat.SplatColor PaleGoldenrod { get; }
+ public static Splat.SplatColor PaleGreen { get; }
+ public static Splat.SplatColor PaleTurquoise { get; }
+ public static Splat.SplatColor PaleVioletRed { get; }
+ public static Splat.SplatColor PapayaWhip { get; }
+ public static Splat.SplatColor PeachPuff { get; }
+ public static Splat.SplatColor Peru { get; }
+ public static Splat.SplatColor Pink { get; }
+ public static Splat.SplatColor Plum { get; }
+ public static Splat.SplatColor PowderBlue { get; }
+ public static Splat.SplatColor Purple { get; }
+ public static Splat.SplatColor Red { get; }
+ public static Splat.SplatColor RosyBrown { get; }
+ public static Splat.SplatColor RoyalBlue { get; }
+ public static Splat.SplatColor SaddleBrown { get; }
+ public static Splat.SplatColor Salmon { get; }
+ public static Splat.SplatColor SandyBrown { get; }
+ public static Splat.SplatColor SeaGreen { get; }
+ public static Splat.SplatColor SeaShell { get; }
+ public static Splat.SplatColor Sienna { get; }
+ public static Splat.SplatColor Silver { get; }
+ public static Splat.SplatColor SkyBlue { get; }
+ public static Splat.SplatColor SlateBlue { get; }
+ public static Splat.SplatColor SlateGray { get; }
+ public static Splat.SplatColor Snow { get; }
+ public static Splat.SplatColor SpringGreen { get; }
+ public static Splat.SplatColor SteelBlue { get; }
+ public static Splat.SplatColor Tan { get; }
+ public static Splat.SplatColor Teal { get; }
+ public static Splat.SplatColor Thistle { get; }
+ public static Splat.SplatColor Tomato { get; }
+ public static Splat.SplatColor Transparent { get; }
+ public static Splat.SplatColor Turquoise { get; }
+ public static Splat.SplatColor Violet { get; }
+ public static Splat.SplatColor Wheat { get; }
+ public static Splat.SplatColor White { get; }
+ public static Splat.SplatColor WhiteSmoke { get; }
+ public static Splat.SplatColor Yellow { get; }
+ public static Splat.SplatColor YellowGreen { get; }
+ public bool Equals(Splat.SplatColor other) { }
+ public override bool Equals(object? obj) { }
+ public float GetBrightness() { }
+ public override int GetHashCode() { }
+ public float GetHue() { }
+ public float GetSaturation() { }
+ public uint ToArgb() { }
+ public Splat.KnownColor ToKnownColor() { }
+ public override string ToString() { }
+ public static Splat.SplatColor FromArgb(uint argb) { }
+ public static Splat.SplatColor FromArgb(int alpha, Splat.SplatColor baseColor) { }
+ public static Splat.SplatColor FromArgb(int red, int green, int blue) { }
+ public static Splat.SplatColor FromArgb(int alpha, int red, int green, int blue) { }
+ public static Splat.SplatColor FromKnownColor(Splat.KnownColor color) { }
+ public static Splat.SplatColor FromName(string name) { }
+ public static bool operator !=(Splat.SplatColor left, Splat.SplatColor right) { }
+ public static bool operator ==(Splat.SplatColor left, Splat.SplatColor right) { }
+ }
+ public static class SplatColorExtensions
+ {
+ public static Splat.SplatColor FromNative(this System.Windows.Media.Color value) { }
+ public static System.Windows.Media.Color ToNative(this Splat.SplatColor value) { }
+ public static System.Windows.Media.SolidColorBrush ToNativeBrush(this Splat.SplatColor value) { }
+ }
+}
\ No newline at end of file
diff --git a/src/Splat.Drawing.Tests/Splat.Drawing.Tests.csproj b/src/Splat.Drawing.Tests/Splat.Drawing.Tests.csproj
index a2dd7cd9f..1ed795b26 100644
--- a/src/Splat.Drawing.Tests/Splat.Drawing.Tests.csproj
+++ b/src/Splat.Drawing.Tests/Splat.Drawing.Tests.csproj
@@ -1,7 +1,7 @@
- net8.0-windows10.0.17763.0
+ net8.0-windows10.0.17763.0;net9.0-windows10.0.17763.0
false
$(NoWarn);1591;CA1707;SA1633;CA2000;CA1034
enable
@@ -9,6 +9,10 @@
true
+
+
+
+
diff --git a/src/Splat.Drawing/Bitmaps/BitmapLoaderException.cs b/src/Splat.Drawing/Bitmaps/BitmapLoaderException.cs
index 10381649e..2620f9895 100644
--- a/src/Splat.Drawing/Bitmaps/BitmapLoaderException.cs
+++ b/src/Splat.Drawing/Bitmaps/BitmapLoaderException.cs
@@ -3,8 +3,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
-using System.Runtime.Serialization;
-
namespace Splat;
///
diff --git a/src/Splat.Drawing/Colors/SplatColor.cs b/src/Splat.Drawing/Colors/SplatColor.cs
index 26dd6b553..002d93ef8 100644
--- a/src/Splat.Drawing/Colors/SplatColor.cs
+++ b/src/Splat.Drawing/Colors/SplatColor.cs
@@ -13,8 +13,7 @@ namespace Splat;
[DataContract]
public partial struct SplatColor : IEquatable
{
- // Private transparency (A) and R,G,B fields.
- private uint _value;
+ //// Private transparency (A) and R,G,B fields.
private short _state;
private short _knownColor;
@@ -27,7 +26,7 @@ public partial struct SplatColor : IEquatable
internal SplatColor(uint value, short state, short knownColor, string name)
{
- _value = value;
+ Value = value;
_state = state;
_knownColor = knownColor;
_name = name;
@@ -130,15 +129,15 @@ internal uint Value
{
// Optimization for known colors that were deserialized
// from an MS serialized stream.
- if (_value == 0 && IsKnownColor)
+ if (field == 0 && IsKnownColor)
{
- _value = KnownColors.FromKnownColor((KnownColor)_knownColor).ToArgb() & 0xFFFFFFFF;
+ field = KnownColors.FromKnownColor((KnownColor)_knownColor).ToArgb() & 0xFFFFFFFF;
}
- return _value;
+ return field;
}
- set => _value = value;
+ set;
}
///
@@ -225,7 +224,7 @@ public static SplatColor FromKnownColor(KnownColor color)
{
c = Empty;
c._state = (short)(ColorType.ARGB | ColorType.Known | ColorType.Named);
- if ((n < 27) || (n > 169))
+ if (n is < 27 or > 169)
{
c._state |= (short)ColorType.System;
}
@@ -409,17 +408,17 @@ internal static SplatColor FromArgbSystem (int alpha, int red, int green, int bl
private static void CheckRGBValues(int red, int green, int blue)
{
- if ((red > 255) || (red < 0))
+ if (red is > 255 or < 0)
{
throw CreateColorArgumentException(red, "red");
}
- if ((green > 255) || (green < 0))
+ if (green is > 255 or < 0)
{
throw CreateColorArgumentException(green, "green");
}
- if ((blue > 255) || (blue < 0))
+ if (blue is > 255 or < 0)
{
throw CreateColorArgumentException(blue, "blue");
}
@@ -430,7 +429,7 @@ private static ArgumentException CreateColorArgumentException(int value, string
private static void CheckARGBValues(int alpha, int red, int green, int blue)
{
- if ((alpha > 255) || (alpha < 0))
+ if (alpha is > 255 or < 0)
{
throw CreateColorArgumentException(alpha, "alpha");
}
diff --git a/src/Splat.Drawing/Splat.Drawing.csproj b/src/Splat.Drawing/Splat.Drawing.csproj
index 5235d04eb..c7a2d39d6 100644
--- a/src/Splat.Drawing/Splat.Drawing.csproj
+++ b/src/Splat.Drawing/Splat.Drawing.csproj
@@ -1,6 +1,6 @@
- $(SplatTargetFrameworks);net8.0-android;net8.0-ios;net8.0-tvos;net8.0-macos;net8.0-maccatalyst
+ $(SplatTargetFrameworks);net8.0-android;net8.0-ios;net8.0-tvos;net8.0-macos;net8.0-maccatalyst;net9.0-android;net9.0-ios;net9.0-tvos;net9.0-macos;net9.0-maccatalyst
$(TargetFrameworks);net462;net472;$(SplatWindowsTargetFrameworks)
Splat
.NET Foundation and Contributors
diff --git a/src/Splat.DryIoc.Tests/Splat.DryIoc.Tests.csproj b/src/Splat.DryIoc.Tests/Splat.DryIoc.Tests.csproj
index 24ad346d9..8a5778d7a 100644
--- a/src/Splat.DryIoc.Tests/Splat.DryIoc.Tests.csproj
+++ b/src/Splat.DryIoc.Tests/Splat.DryIoc.Tests.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net8.0;net9.0
$(NoWarn);1591;CA1707;SA1633;CA2000
enable
diff --git a/src/Splat.Exceptionless/ExceptionlessFeatureUsageTrackingSession.cs b/src/Splat.Exceptionless/ExceptionlessFeatureUsageTrackingSession.cs
index a32ea93d5..8c3656b98 100644
--- a/src/Splat.Exceptionless/ExceptionlessFeatureUsageTrackingSession.cs
+++ b/src/Splat.Exceptionless/ExceptionlessFeatureUsageTrackingSession.cs
@@ -40,11 +40,10 @@ internal ExceptionlessFeatureUsageTrackingSession(
if (!parentReference.Equals(Guid.Empty))
{
- eventBuilder.SetEventReference(FeatureName, FeatureReference.ToString());
+ eventBuilder = eventBuilder.SetEventReference(FeatureName, FeatureReference.ToString());
}
- eventBuilder.SetReferenceId(FeatureReference.ToString());
- eventBuilder.Submit();
+ eventBuilder.SetReferenceId(FeatureReference.ToString()).Submit();
}
///
diff --git a/src/Splat.Exceptionless/MutableDependencyResolverExtensions.cs b/src/Splat.Exceptionless/MutableDependencyResolverExtensions.cs
index 7bf715a70..915c13be0 100644
--- a/src/Splat.Exceptionless/MutableDependencyResolverExtensions.cs
+++ b/src/Splat.Exceptionless/MutableDependencyResolverExtensions.cs
@@ -35,6 +35,6 @@ public static void UseExceptionlessWithWrappingFullLogger(this IMutableDependenc
return new WrappingFullLogger(miniLoggingWrapper);
});
- instance.RegisterConstant(funcLogManager, typeof(ILogManager));
+ instance.RegisterConstant(funcLogManager);
}
}
diff --git a/src/Splat.Log4Net/MutableDependencyResolverExtensions.cs b/src/Splat.Log4Net/MutableDependencyResolverExtensions.cs
index ad450b9a2..6a024cd86 100644
--- a/src/Splat.Log4Net/MutableDependencyResolverExtensions.cs
+++ b/src/Splat.Log4Net/MutableDependencyResolverExtensions.cs
@@ -28,6 +28,6 @@ public static void UseLog4NetWithWrappingFullLogger(this IMutableDependencyResol
{
var funcLogManager = new FuncLogManager(type => new WrappingFullLogger(new Log4NetLogger(LogResolver.Resolve(type))));
- instance.RegisterConstant(funcLogManager, typeof(ILogManager));
+ instance.RegisterConstant(funcLogManager);
}
}
diff --git a/src/Splat.Log4Net/Splat.Log4Net.csproj b/src/Splat.Log4Net/Splat.Log4Net.csproj
index 501b0f6b7..ebb062fb6 100644
--- a/src/Splat.Log4Net/Splat.Log4Net.csproj
+++ b/src/Splat.Log4Net/Splat.Log4Net.csproj
@@ -21,6 +21,7 @@
+
diff --git a/src/Splat.Microsoft.Extensions.DependencyInjection.Tests/Splat.Microsoft.Extensions.DependencyInjection.Tests.csproj b/src/Splat.Microsoft.Extensions.DependencyInjection.Tests/Splat.Microsoft.Extensions.DependencyInjection.Tests.csproj
index 3244e46eb..c0ca2072b 100644
--- a/src/Splat.Microsoft.Extensions.DependencyInjection.Tests/Splat.Microsoft.Extensions.DependencyInjection.Tests.csproj
+++ b/src/Splat.Microsoft.Extensions.DependencyInjection.Tests/Splat.Microsoft.Extensions.DependencyInjection.Tests.csproj
@@ -1,7 +1,7 @@
- net6.0;net8.0
+ net8.0;net9.0
$(NoWarn);1591;CA1707;SA1633;CA2000
false
enable
diff --git a/src/Splat.Microsoft.Extensions.DependencyInjection/MicrosoftDependencyResolver.cs b/src/Splat.Microsoft.Extensions.DependencyInjection/MicrosoftDependencyResolver.cs
index bb5ad06c9..5e0533bf2 100644
--- a/src/Splat.Microsoft.Extensions.DependencyInjection/MicrosoftDependencyResolver.cs
+++ b/src/Splat.Microsoft.Extensions.DependencyInjection/MicrosoftDependencyResolver.cs
@@ -165,7 +165,7 @@ public virtual void UnregisterCurrent(Type? serviceType, string? contract = null
var sd = _serviceCollection?.LastOrDefault(s => !s.IsKeyedService && s.ServiceType == serviceType);
if (sd is not null)
{
- _serviceCollection?.Remove(sd);
+ _ = _serviceCollection?.Remove(sd);
}
}
else
@@ -173,7 +173,7 @@ public virtual void UnregisterCurrent(Type? serviceType, string? contract = null
var sd = _serviceCollection?.LastOrDefault(sd => MatchesKeyedContract(serviceType, contract, sd));
if (sd is not null)
{
- _serviceCollection?.Remove(sd);
+ _ = _serviceCollection?.Remove(sd);
}
}
@@ -216,7 +216,7 @@ public virtual void UnregisterAll(Type? serviceType, string? contract = null)
foreach (var sd in sds.ToList())
{
- _serviceCollection.Remove(sd);
+ _ = _serviceCollection.Remove(sd);
}
// required so that it gets rebuilt if not injected externally.
diff --git a/src/Splat.Microsoft.Extensions.Logging/MicrosoftExtensionsLoggingExtensions.cs b/src/Splat.Microsoft.Extensions.Logging/MicrosoftExtensionsLoggingExtensions.cs
index 9ea21999a..0f943e612 100644
--- a/src/Splat.Microsoft.Extensions.Logging/MicrosoftExtensionsLoggingExtensions.cs
+++ b/src/Splat.Microsoft.Extensions.Logging/MicrosoftExtensionsLoggingExtensions.cs
@@ -41,7 +41,7 @@ public static void UseMicrosoftExtensionsLoggingWithWrappingFullLogger(
return new WrappingFullLogger(miniLoggingWrapper);
});
- instance.RegisterConstant(funcLogManager, typeof(ILogManager));
+ instance.RegisterConstant(funcLogManager);
}
///
diff --git a/src/Splat.NLog/MutableDependencyResolverExtensions.cs b/src/Splat.NLog/MutableDependencyResolverExtensions.cs
index de0503de2..aaf507700 100644
--- a/src/Splat.NLog/MutableDependencyResolverExtensions.cs
+++ b/src/Splat.NLog/MutableDependencyResolverExtensions.cs
@@ -28,6 +28,6 @@ public static void UseNLogWithWrappingFullLogger(this IMutableDependencyResolver
{
var funcLogManager = new FuncLogManager(type => new NLogLogger(LogResolver.Resolve(type)));
- instance.RegisterConstant(funcLogManager, typeof(ILogManager));
+ instance.RegisterConstant(funcLogManager);
}
}
diff --git a/src/Splat.Ninject.Tests/Splat.Ninject.Tests.csproj b/src/Splat.Ninject.Tests/Splat.Ninject.Tests.csproj
index 6c331e0f4..9a284a289 100644
--- a/src/Splat.Ninject.Tests/Splat.Ninject.Tests.csproj
+++ b/src/Splat.Ninject.Tests/Splat.Ninject.Tests.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net8.0;net9.0
$(NoWarn);1591;CA1707;SA1633;CA2000
false
enable
diff --git a/src/Splat.Ninject/NinjectDependencyResolver.cs b/src/Splat.Ninject/NinjectDependencyResolver.cs
index 991865310..d93cbdde8 100644
--- a/src/Splat.Ninject/NinjectDependencyResolver.cs
+++ b/src/Splat.Ninject/NinjectDependencyResolver.cs
@@ -34,11 +34,15 @@ public virtual IEnumerable