mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Plugins - Separated plugins and implementations as different principles
This commit is contained in:
1 parent
c0d0e421c7
commit
1e0dc1894d
53 files changed
+438
-410
No files matched your search
@@ -11,9 +11,9 @@ namespace Artemis.Core.Services
|
||||
public DataModelService(IPluginService pluginService)
|
||||
{
|
||||
// Add data models of already loaded plugins
|
||||
foreach (Module module in pluginService.GetPluginsOfType<Module>().Where(p => p.Enabled))
|
||||
foreach (Module module in pluginService.GetPluginsOfType<Module>().Where(p => p.IsEnabled))
|
||||
AddModuleDataModel(module);
|
||||
foreach (BaseDataModelExpansion dataModelExpansion in pluginService.GetPluginsOfType<BaseDataModelExpansion>().Where(p => p.Enabled))
|
||||
foreach (BaseDataModelExpansion dataModelExpansion in pluginService.GetPluginsOfType<BaseDataModelExpansion>().Where(p => p.IsEnabled))
|
||||
AddDataModelExpansionDataModel(dataModelExpansion);
|
||||
|
||||
// Add data models of new plugins when they get enabled
|
||||
@@ -44,9 +44,9 @@ namespace Artemis.Core.Services
|
||||
return (T) DataModelStore.GetAll().FirstOrDefault(d => d.DataModel is T)?.DataModel;
|
||||
}
|
||||
|
||||
public DataModel GetPluginDataModel(Plugin plugin)
|
||||
public DataModel GetPluginDataModel(PluginImplementation pluginImplementation)
|
||||
{
|
||||
return DataModelStore.Get(plugin.PluginInfo.Guid)?.DataModel;
|
||||
return DataModelStore.Get(pluginImplementation.PluginInfo.Guid)?.DataModel;
|
||||
}
|
||||
|
||||
public DataModel GetPluginDataModel(Guid pluginGuid)
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace Artemis.Core.Services
|
||||
/// <summary>
|
||||
/// If found, returns the data model of the provided plugin
|
||||
/// </summary>
|
||||
/// <param name="plugin">The plugin to find the data model of</param>
|
||||
DataModel GetPluginDataModel(Plugin plugin);
|
||||
/// <param name="pluginImplementation">The plugin to find the data model of</param>
|
||||
DataModel GetPluginDataModel(PluginImplementation pluginImplementation);
|
||||
|
||||
/// <summary>
|
||||
/// If found, returns the data model of the provided plugin GUID
|
||||
|
||||
Reference in new issue
Block a user