Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,27 @@
<PackageVersion Include="NuGet.Protocol" Version="7.6.0" />
<PackageVersion Include="Nuke.Common" Version="10.1.0" />
<PackageVersion Include="PublicApiGenerator" Version="11.5.4" />
<PackageVersion Include="ReactiveUI.Primitives.Core" Version="6.0.0" />
<!--Reactive UI with ReactiveUI.Primitives support-->
<PackageVersion Include="ReactiveUI.Primitives" Version="6.0.0" />
<PackageVersion Include="ReactiveUI" Version="24.0.0-beta.3" />
<PackageVersion Include="ReactiveUI.Avalonia" Version="12.1.0-beta.1" />
<PackageVersion Include="ReactiveUI.Core" Version="24.0.0-beta.3" />
<PackageVersion Include="ReactiveUI.Disposables" Version="6.0.0" />
<PackageVersion Include="ReactiveUI.Drawing" Version="24.0.0-beta.3" />
<PackageVersion Include="ReactiveUI.Maui" Version="24.0.0-beta.3" />
<PackageVersion Include="ReactiveUI.Primitives" Version="6.0.0" />
<PackageVersion Include="ReactiveUI.Primitives.Core" Version="6.0.0" />
<PackageVersion Include="ReactiveUI.Primitives.Reactive" Version="6.0.0" />
<PackageVersion Include="ReactiveUI.WinForms" Version="24.0.0-beta.3" />
<PackageVersion Include="ReactiveUI.WinUI" Version="24.0.0-beta.3" />
<PackageVersion Include="ReactiveUI.WPF" Version="24.0.0-beta.3" />
<PackageVersion Include="ReactiveUI.Reactive" Version="24.0.0-beta.3" />
<!--Reactive UI with System.Reactive support-->
<PackageVersion Include="ReactiveUI.Primitives.Reactive" Version="6.0.0" />
<PackageVersion Include="ReactiveUI.Avalonia.Reactive" Version="12.1.0-beta.1" />
<PackageVersion Include="ReactiveUI.Drawing.Reactive" Version="24.0.0-beta.3" />
<PackageVersion Include="ReactiveUI.Maui.Reactive" Version="24.0.0-beta.3" />
<PackageVersion Include="ReactiveUI.WinForms.Reactive" Version="24.0.0-beta.3" />
<PackageVersion Include="ReactiveUI.WinUI.Reactive" Version="24.0.0-beta.3" />
<PackageVersion Include="ReactiveUI.WPF.Reactive" Version="24.0.0-beta.3" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.15.0" />
<PackageVersion Include="Splat" Version="20.0.0" />
<PackageVersion Include="Splat.Microsoft.Extensions.DependencyInjection" Version="20.0.0" />
Expand Down
1,139 changes: 888 additions & 251 deletions README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;net472;net48;net481;net8.0-windows;net9.0-windows;net10.0-windows;net11.0-windows</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>CP.Extensions.Hosting.PluginService.Reactive</PackageId>
<DefineConstants>$(DefineConstants);REACTIVE_SHIM</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Extensions.Hosting.PluginService\**\*.cs" Exclude="..\Extensions.Hosting.PluginService\bin\**;..\Extensions.Hosting.PluginService\obj\**" Link="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" />
<PackageReference Include="Microsoft.Extensions.Logging.TraceSource" />
<PackageReference Include="System.ServiceProcess.ServiceController" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Extensions.Hosting.Plugins.Reactive\Extensions.Hosting.Plugins.Reactive.csproj" />
<ProjectReference Include="..\Extensions.Logging.Log4Net\Extensions.Logging.Log4Net.csproj" />
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions src/Extensions.Hosting.PluginService/DefaultLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

using Microsoft.Extensions.Logging;

#if REACTIVE_SHIM
namespace ReactiveMarbles.Extensions.Hosting.Reactive.PluginService;
#else
namespace ReactiveMarbles.Extensions.Hosting.PluginService;
#endif

/// <summary>Provides a default implementation of a logger that wraps an existing <see cref="ILogger"/> instance.</summary>
/// <param name="logger">The underlying <see cref="ILogger{DefaultLogger}"/> instance to use for logging operations. Cannot be null.</param>
Expand Down
4 changes: 4 additions & 0 deletions src/Extensions.Hosting.PluginService/ServiceBaseLifetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
using System.ServiceProcess;
using Microsoft.Extensions.Hosting;

#if REACTIVE_SHIM
namespace ReactiveMarbles.Extensions.Hosting.Reactive.PluginService;
#else
namespace ReactiveMarbles.Extensions.Hosting.PluginService;
#endif

/// <summary>Provides an <see cref="IHostLifetime"/> implementation backed by <see cref="ServiceBase"/>.</summary>
/// <seealso cref="ServiceBase" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Hosting.Internal;

#if REACTIVE_SHIM
namespace ReactiveMarbles.Extensions.Hosting.Reactive.PluginService;
#else
namespace ReactiveMarbles.Extensions.Hosting.PluginService;
#endif

/// <summary>Provides extension methods for configuring host lifetimes to enable running .NET applications as Windows services or with console lifetime support.</summary>
/// <remarks>These extensions allow integration of service-based or console-based lifetimes into host builders,
Expand Down
8 changes: 8 additions & 0 deletions src/Extensions.Hosting.PluginService/ServiceHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
#if REACTIVE_SHIM
using ReactiveMarbles.Extensions.Hosting.Reactive.Plugins;
#else
using ReactiveMarbles.Extensions.Hosting.Plugins;
#endif
using ReactiveMarbles.Extensions.Logging;

#if REACTIVE_SHIM
namespace ReactiveMarbles.Extensions.Hosting.Reactive.PluginService;
#else
namespace ReactiveMarbles.Extensions.Hosting.PluginService;
#endif

/// <summary>Provides static methods for configuring and running a host or application host with plugin and logging support.</summary>
/// <remarks>The ServiceHost class simplifies the setup of .NET hosts, including configuration, logging, and
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>CP.Extensions.Hosting.ReactiveUI.Avalonia.Reactive</PackageId>
<DefineConstants>$(DefineConstants);REACTIVE_SHIM</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Extensions.Hosting.ReactiveUI.Avalonia\**\*.cs" Exclude="..\Extensions.Hosting.ReactiveUI.Avalonia\bin\**;..\Extensions.Hosting.ReactiveUI.Avalonia\obj\**" Link="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Extensions.Hosting.Avalonia\Extensions.Hosting.Avalonia.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Splat" />
<PackageReference Include="Splat.Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="ReactiveUI.Avalonia.Reactive" />
<PackageReference Include="ReactiveUI.Primitives.Reactive" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@
// See the LICENSE file in the project root for full license information.

using Microsoft.Extensions.Hosting;
#if REACTIVE_SHIM
using ReactiveUI.Avalonia.Reactive;
using ReactiveUI.Reactive.Builder;
#else
using ReactiveUI.Avalonia;
using ReactiveUI.Builder;
#endif
using Splat;
using Splat.Microsoft.Extensions.DependencyInjection;

#if REACTIVE_SHIM
namespace ReactiveMarbles.Extensions.Hosting.Reactive.ReactiveUI;
#else
namespace ReactiveMarbles.Extensions.Hosting.ReactiveUI;
#endif

/// <summary>Provides extension methods for configuring ReactiveUI with Microsoft dependency injection in .NET host builder scenarios.</summary>
/// <remarks>These extension methods enable seamless integration of ReactiveUI and Splat with the Microsoft
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net10.0;net11.0;net10.0-android;net11.0-android;net10.0-ios;net10.0-tvos;net10.0-macos;net10.0-maccatalyst;net11.0-ios;net11.0-tvos;net11.0-macos;net11.0-maccatalyst;</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0;net11.0-windows10.0.19041.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseMaui>true</UseMaui>
<PackageId>CP.Extensions.Hosting.ReactiveUI.Maui.Reactive</PackageId>
<DefineConstants>$(DefineConstants);REACTIVE_SHIM</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Extensions.Hosting.ReactiveUI.Maui\**\*.cs" Exclude="..\Extensions.Hosting.ReactiveUI.Maui\bin\**;..\Extensions.Hosting.ReactiveUI.Maui\obj\**" Link="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Splat" />
<PackageReference Include="Splat.Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="ReactiveUI.Maui.Reactive" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('net10')) ">
<PackageReference Include="Microsoft.Maui.Controls" />
<PackageReference Include="Microsoft.Maui.Core" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('net11')) ">
<PackageReference Include="Microsoft.Maui.Controls" />
<PackageReference Include="Microsoft.Maui.Core" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Extensions.Hosting.Maui\Extensions.Hosting.Maui.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
// See the LICENSE file in the project root for full license information.

using Microsoft.Extensions.Hosting;
#if REACTIVE_SHIM
using ReactiveUI.Reactive.Builder;
#else
using ReactiveUI.Builder;
#endif
using Splat;
using Splat.Microsoft.Extensions.DependencyInjection;

#if REACTIVE_SHIM
namespace ReactiveMarbles.Extensions.Hosting.Reactive.ReactiveUI;
#else
namespace ReactiveMarbles.Extensions.Hosting.ReactiveUI;
#endif

/// <summary>Provides extension methods for configuring ReactiveUI integration with Microsoft dependency injection in .NET host builders.</summary>
/// <remarks>These extensions enable seamless setup of ReactiveUI and Splat with Microsoft.Extensions.Hosting and
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!--ReactiveUI only supports windows 10.0.19041 plus-->
<TargetFrameworks>net462;net472;net48;net481;net8.0-windows10.0.19041;net9.0-windows10.0.19041;net10.0-windows10.0.19041;net11.0-windows10.0.19041</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageDescription>This extension adds reactive ReactiveUI support to generic host based WinForms applications.</PackageDescription>
<PackageId>CP.Extensions.Hosting.ReactiveUI.WinForms.Reactive</PackageId>
<DefineConstants>$(DefineConstants);REACTIVE_SHIM</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Extensions.Hosting.ReactiveUI.WinForms\**\*.cs" Exclude="..\Extensions.Hosting.ReactiveUI.WinForms\bin\**;..\Extensions.Hosting.ReactiveUI.WinForms\obj\**" Link="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Splat" />
<PackageReference Include="Splat.Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="ReactiveUI.Drawing.Reactive" />
<PackageReference Include="ReactiveUI.WinForms.Reactive" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Extensions.Hosting.WinForms\Extensions.Hosting.WinForms.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
// See the LICENSE file in the project root for full license information.

using Microsoft.Extensions.Hosting;
#if REACTIVE_SHIM
using ReactiveUI.Reactive.Builder;
#else
using ReactiveUI.Builder;
#endif
using Splat;
using Splat.Microsoft.Extensions.DependencyInjection;

#if REACTIVE_SHIM
namespace ReactiveMarbles.Extensions.Hosting.Reactive.ReactiveUI;
#else
namespace ReactiveMarbles.Extensions.Hosting.ReactiveUI;
#endif

/// <summary>Provides extension methods for configuring ReactiveUI with Microsoft dependency injection in .NET host builders.</summary>
/// <remarks>These extensions enable integration of ReactiveUI's dependency resolution with the
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!--ReactiveUI only supports windows 10.0.19041 plus-->
<TargetFrameworks>net8.0-windows10.0.19041;net9.0-windows10.0.19041;net10.0-windows10.0.19041;net11.0-windows10.0.19041</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);NETSDK1206</NoWarn>
<RuntimeIdentifiers>win-x64;win-x86;win-arm64</RuntimeIdentifiers>
<PackageDescription>This extension adds reactive ReactiveUI support to generic host based WinUI applications.</PackageDescription>
<PackageId>CP.Extensions.Hosting.ReactiveUI.WinUI.Reactive</PackageId>
<DefineConstants>$(DefineConstants);REACTIVE_SHIM</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Extensions.Hosting.ReactiveUI.WinUI\**\*.cs" Exclude="..\Extensions.Hosting.ReactiveUI.WinUI\bin\**;..\Extensions.Hosting.ReactiveUI.WinUI\obj\**" Link="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Splat" />
<PackageReference Include="Splat.Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="ReactiveUI.WinUI.Reactive" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Extensions.Hosting.WinUI\Extensions.Hosting.WinUI.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@

using Microsoft.Extensions.Hosting;
using ReactiveUI.Builder;

#if REACTIVE_SHIM
using ReactiveUI.Reactive.Builder;
#endif
using Splat;
using Splat.Microsoft.Extensions.DependencyInjection;

#if REACTIVE_SHIM
namespace ReactiveMarbles.Extensions.Hosting.Reactive.ReactiveUI;
#else
namespace ReactiveMarbles.Extensions.Hosting.ReactiveUI;
#endif

/// <summary>Provides extension methods for configuring ReactiveUI integration with Microsoft dependency injection in .NET host builders.</summary>
/// <remarks>These extensions enable seamless setup of ReactiveUI and Splat with Microsoft.Extensions.Hosting and
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!--ReactiveUI only supports windows 10.0.19041 plus-->
<TargetFrameworks>net462;net472;net48;net481;net8.0-windows10.0.19041;net9.0-windows10.0.19041;net10.0-windows10.0.19041;net11.0-windows10.0.19041</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageDescription>This extension adds reactive ReactiveUI support to generic host based WPF applications.</PackageDescription>
<PackageId>CP.Extensions.Hosting.ReactiveUI.Wpf.Reactive</PackageId>
<DefineConstants>$(DefineConstants);REACTIVE_SHIM</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Extensions.Hosting.ReactiveUI.Wpf\**\*.cs" Exclude="..\Extensions.Hosting.ReactiveUI.Wpf\bin\**;..\Extensions.Hosting.ReactiveUI.Wpf\obj\**" Link="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Splat" />
<PackageReference Include="Splat.Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="ReactiveUI.Drawing.Reactive" />
<PackageReference Include="ReactiveUI.WPF.Reactive" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Extensions.Hosting.Wpf\Extensions.Hosting.Wpf.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
// See the LICENSE file in the project root for full license information.

using Microsoft.Extensions.Hosting;
#if REACTIVE_SHIM
using ReactiveUI.Reactive.Builder;
#else
using ReactiveUI.Builder;
#endif
using Splat;
using Splat.Microsoft.Extensions.DependencyInjection;

#if REACTIVE_SHIM
namespace ReactiveMarbles.Extensions.Hosting.Reactive.ReactiveUI;
#else
namespace ReactiveMarbles.Extensions.Hosting.ReactiveUI;
#endif

/// <summary>Provides extension methods for configuring ReactiveUI with Microsoft dependency injection in .NET host builder scenarios.</summary>
/// <remarks>These extension methods enable seamless integration of ReactiveUI and Splat with the Microsoft
Expand Down
6 changes: 6 additions & 0 deletions src/Extensions.Hosting.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@
<Project Path="Extensions.Hosting.Plugins/Extensions.Hosting.Plugins.csproj" />
<Project Path="Extensions.Hosting.Plugins.Reactive/Extensions.Hosting.Plugins.Reactive.csproj" />
<Project Path="Extensions.Hosting.PluginService/Extensions.Hosting.PluginService.csproj" />
<Project Path="Extensions.Hosting.PluginService.Reactive/Extensions.Hosting.PluginService.Reactive.csproj" />
<Project Path="Extensions.Hosting.ReactiveUI.Avalonia/Extensions.Hosting.ReactiveUI.Avalonia.csproj" Id="711b6a7d-e7b8-4903-9015-43116783fc45" />
<Project Path="Extensions.Hosting.ReactiveUI.Avalonia.Reactive/Extensions.Hosting.ReactiveUI.Avalonia.Reactive.csproj" />
<Project Path="Extensions.Hosting.ReactiveUI.Maui/Extensions.Hosting.ReactiveUI.Maui.csproj" />
<Project Path="Extensions.Hosting.ReactiveUI.Maui.Reactive/Extensions.Hosting.ReactiveUI.Maui.Reactive.csproj" />
<Project Path="Extensions.Hosting.ReactiveUI.WinForms/Extensions.Hosting.ReactiveUI.WinForms.csproj" />
<Project Path="Extensions.Hosting.ReactiveUI.WinForms.Reactive/Extensions.Hosting.ReactiveUI.WinForms.Reactive.csproj" />
<Project Path="Extensions.Hosting.ReactiveUI.WinUI/Extensions.Hosting.ReactiveUI.WinUI.csproj" />
<Project Path="Extensions.Hosting.ReactiveUI.WinUI.Reactive/Extensions.Hosting.ReactiveUI.WinUI.Reactive.csproj" />
<Project Path="Extensions.Hosting.ReactiveUI.Wpf/Extensions.Hosting.ReactiveUI.Wpf.csproj" />
<Project Path="Extensions.Hosting.ReactiveUI.Wpf.Reactive/Extensions.Hosting.ReactiveUI.Wpf.Reactive.csproj" />
<Project Path="Extensions.Hosting.SingleInstance/Extensions.Hosting.SingleInstance.csproj" />
<Project Path="Extensions.Hosting.WinForms/Extensions.Hosting.WinForms.csproj" />
<Project Path="Extensions.Hosting.WinUI/Extensions.Hosting.WinUI.csproj" />
Expand Down