mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Plugins - Reworked most of the activation logic
This commit is contained in:
1 parent
1e0dc1894d
commit
b56966c585
34 files changed
+509
-362
No files matched your search
@@ -22,7 +22,7 @@ namespace Artemis.UI.Shared
|
||||
ViewModelType = viewModelType;
|
||||
|
||||
if (PluginInfo != Constants.CorePluginInfo)
|
||||
PluginInfo.Instance.Disabled += InstanceOnDisabled;
|
||||
PluginInfo.Plugin.Disabled += InstanceOnDisabled;
|
||||
}
|
||||
|
||||
public RegistrationType RegistrationType { get; }
|
||||
@@ -35,7 +35,7 @@ namespace Artemis.UI.Shared
|
||||
internal void Unsubscribe()
|
||||
{
|
||||
if (PluginInfo != Constants.CorePluginInfo)
|
||||
PluginInfo.Instance.Disabled -= InstanceOnDisabled;
|
||||
PluginInfo.Plugin.Disabled -= InstanceOnDisabled;
|
||||
}
|
||||
|
||||
private void InstanceOnDisabled(object sender, EventArgs e)
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Artemis.UI.Shared
|
||||
ViewModelType = viewModelType;
|
||||
|
||||
if (PluginInfo != Constants.CorePluginInfo)
|
||||
PluginInfo.Instance.Disabled += InstanceOnDisabled;
|
||||
PluginInfo.Plugin.Disabled += InstanceOnDisabled;
|
||||
}
|
||||
|
||||
public PluginInfo PluginInfo { get; }
|
||||
@@ -26,7 +26,7 @@ namespace Artemis.UI.Shared
|
||||
internal void Unsubscribe()
|
||||
{
|
||||
if (PluginInfo != Constants.CorePluginInfo)
|
||||
PluginInfo.Instance.Disabled -= InstanceOnDisabled;
|
||||
PluginInfo.Plugin.Disabled -= InstanceOnDisabled;
|
||||
}
|
||||
|
||||
private void InstanceOnDisabled(object sender, EventArgs e)
|
||||
|
||||
@@ -22,14 +22,14 @@ namespace Artemis.UI.Shared.Services
|
||||
private readonly IKernel _kernel;
|
||||
private readonly IViewManager _viewManager;
|
||||
private readonly IWindowManager _windowManager;
|
||||
private readonly IPluginService _pluginService;
|
||||
private readonly IPluginManagementService _pluginManagementService;
|
||||
|
||||
public DialogService(IKernel kernel, IViewManager viewManager, IWindowManager windowManager, IPluginService pluginService)
|
||||
public DialogService(IKernel kernel, IViewManager viewManager, IWindowManager windowManager, IPluginManagementService pluginManagementService)
|
||||
{
|
||||
_kernel = kernel;
|
||||
_viewManager = viewManager;
|
||||
_windowManager = windowManager;
|
||||
_pluginService = pluginService;
|
||||
_pluginManagementService = pluginManagementService;
|
||||
}
|
||||
|
||||
private async Task<object> ShowDialog<T>(IParameter[] parameters) where T : DialogViewModelBase
|
||||
@@ -109,7 +109,7 @@ namespace Artemis.UI.Shared.Services
|
||||
|
||||
private async Task<object> ShowDialogAt<T>(string identifier, IParameter[] parameters) where T : DialogViewModelBase
|
||||
{
|
||||
PluginImplementation callingPluginImplementation = _pluginService.GetCallingPlugin();
|
||||
PluginImplementation callingPluginImplementation = _pluginManagementService.GetCallingPlugin();
|
||||
if (parameters == null) throw new ArgumentNullException(nameof(parameters));
|
||||
|
||||
if (callingPluginImplementation != null)
|
||||
|
||||
Reference in new issue
Block a user