Skip to content

Commit 2d474ae

Browse files
committed
Feat | IPluginEventService
1 parent b96755a commit 2d474ae

4 files changed

Lines changed: 49 additions & 3 deletions

File tree

ShadowPluginLoader.WinUI/DIFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static DiFactory()
2626
Made.Of(() => Serilog.Log.ForContext(Arg.Index<Type>(0)),
2727
r => r.ImplementationType ?? r.Parent.ImplementationType ?? typeof(object)),
2828
setup: Setup.With(condition: r => r.Parent.ImplementationType != null || r.ImplementationType != null));
29-
Services.Register<PluginEventService>(reuse: Reuse.Singleton);
29+
Services.Register<IPluginEventService, PluginEventService>(reuse: Reuse.Singleton);
3030
}
3131

3232
/// <summary>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
using System;
2+
using ShadowPluginLoader.WinUI.Args;
3+
4+
namespace ShadowPluginLoader.WinUI.Services;
5+
6+
/// <summary>
7+
/// PluginEvent Service
8+
/// </summary>
9+
public interface IPluginEventService
10+
{
11+
/// <summary>
12+
/// Plugin Enabled
13+
/// </summary>
14+
event EventHandler<PluginEventArgs>? PluginEnabled;
15+
16+
/// <summary>
17+
/// Plugin Disabled
18+
/// </summary>
19+
event EventHandler<PluginEventArgs>? PluginDisabled;
20+
21+
/// <summary>
22+
/// Plugin Loaded
23+
/// </summary>
24+
event EventHandler<PluginEventArgs>? PluginLoaded;
25+
26+
27+
/// <summary>
28+
/// Plugin Plan Upgrade
29+
/// </summary>
30+
event EventHandler<PluginEventArgs>? PluginPlanUpgrade;
31+
32+
/// <summary>
33+
/// Plugin Upgraded
34+
/// </summary>
35+
event EventHandler<PluginEventArgs>? PluginUpgraded;
36+
37+
/// <summary>
38+
/// Plugin Plan Remove
39+
/// </summary>
40+
event EventHandler<PluginEventArgs>? PluginPlanRemove;
41+
42+
/// <summary>
43+
/// Plugin Removed
44+
/// </summary>
45+
event EventHandler<PluginEventArgs>? PluginRemoved;
46+
}

ShadowPluginLoader.WinUI/Services/PluginEventService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace ShadowPluginLoader.WinUI.Services;
77
/// <summary>
88
/// PluginEvent Service
99
/// </summary>
10-
public class PluginEventService
10+
public class PluginEventService: IPluginEventService
1111
{
1212
private ILogger Logger { get; }
1313

ShadowPluginLoader.WinUI/ShadowPluginLoader.WinUI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1414
<LangVersion>preview</LangVersion>
1515
<!-- Nuget -->
16-
<Version>3.1.8</Version>
16+
<Version>3.1.9</Version>
1717
<PackageId>ShadowPluginLoader.WinUI</PackageId>
1818
<Owner>kitUIN</Owner>
1919
<Authors>kitUIN</Authors>

0 commit comments

Comments
 (0)