-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from ChrisPulman/FeatureReactiveUI
Feature Add ReactiveUI, Add PluginBase
- Loading branch information
Showing
19 changed files
with
360 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/Dapplo.Microsoft.Extensions.Hosting.Plugins/PluginBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Hosting; | ||
|
||
namespace Dapplo.Microsoft.Extensions.Hosting.Plugins; | ||
|
||
/// <summary> | ||
/// Plugin Base. | ||
/// </summary> | ||
/// <typeparam name="T">The type of Plugin.</typeparam> | ||
/// <seealso cref="IPlugin" /> | ||
public class PluginBase<T> : IPlugin | ||
where T : class, IHostedService | ||
{ | ||
/// <inheritdoc /> | ||
public void ConfigureHost(HostBuilderContext hostBuilderContext, IServiceCollection serviceCollection) => | ||
serviceCollection.AddHostedService<T>(); | ||
} | ||
|
||
/// <summary> | ||
/// Plugin Base. | ||
/// </summary> | ||
/// <typeparam name="T1">The type of the 1st Plugin.</typeparam> | ||
/// <typeparam name="T2">The type of the 2nd Plugin.</typeparam> | ||
/// <seealso cref="IPlugin" /> | ||
public class PluginBase<T1, T2> : IPlugin | ||
where T1 : class, IHostedService | ||
where T2 : class, IHostedService | ||
{ | ||
/// <inheritdoc /> | ||
public void ConfigureHost(HostBuilderContext hostBuilderContext, IServiceCollection serviceCollection) => | ||
serviceCollection.AddHostedService<T1>().AddHostedService<T2>(); | ||
} | ||
|
||
/// <summary> | ||
/// Plugin Base. | ||
/// </summary> | ||
/// <typeparam name="T1">The type of the 1st Plugin.</typeparam> | ||
/// <typeparam name="T2">The type of the 2nd Plugin.</typeparam> | ||
/// <typeparam name="T3">The type of the 3rd Plugin.</typeparam> | ||
/// <seealso cref="Dapplo.Microsoft.Extensions.Hosting.Plugins.IPlugin" /> | ||
/// <seealso cref="IPlugin" /> | ||
public class PluginBase<T1, T2, T3> : IPlugin | ||
where T1 : class, IHostedService | ||
where T2 : class, IHostedService | ||
where T3 : class, IHostedService | ||
{ | ||
/// <inheritdoc /> | ||
public void ConfigureHost(HostBuilderContext hostBuilderContext, IServiceCollection serviceCollection) => | ||
serviceCollection.AddHostedService<T1>().AddHostedService<T2>().AddHostedService<T3>(); | ||
} |
Oops, something went wrong.