Plugins working again

This commit is contained in:
SpoinkyNL committed 2018-03-02 23:46:55 +01:00
1 parent 25f832cba5
commit 7a2717d8b9
17 files changed
+108 -122

No files matched your search

-4
View File
@@ -208,10 +208,6 @@
<Project>{cd23bc5e-57f0-46ce-a007-24d031146219}</Project>
<Name>Artemis.Plugins</Name>
</ProjectReference>
<ProjectReference Include="..\Module.General\Module.General.csproj">
<Project>{58113cc5-a9ca-4ec3-ab4e-3c94b99268d8}</Project>
<Name>Module.General</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Models\" />
+5 -10
View File
@@ -1,5 +1,9 @@
using Artemis.Core.Services.Interfaces;
using System.Linq;
using System.Reflection;
using Artemis.Core.Services.Interfaces;
using Artemis.Plugins.Interfaces;
using Artemis.Plugins.Models;
using Newtonsoft.Json;
using Ninject.Extensions.Conventions;
using Ninject.Modules;
@@ -18,15 +22,6 @@ namespace Artemis.Core.Ninject
.BindAllInterfaces()
.Configure(c => c.InSingletonScope());
});
// Bind all built-in plugins
Kernel.Bind(x =>
{
x.FromThisAssembly()
.SelectAllClasses()
.InheritedFrom<IPlugin>()
.BindAllBaseClasses();
});
}
}
}
+2 -4
View File
@@ -42,10 +42,6 @@ namespace Artemis.Core.Services
pluginInfo.Dispose();
_plugins.Clear();
// Load all built-in plugins
foreach (var builtInPlugin in _kernel.GetAll<IPlugin>())
_plugins.Add(PluginInfo.FromBuiltInPlugin(_kernel, builtInPlugin));
// Iterate all plugin folders and load each plugin
foreach (var directory in Directory.GetDirectories(Constants.DataFolder + "plugins"))
_plugins.Add(await PluginInfo.FromFolder(_kernel, directory));
@@ -53,11 +49,13 @@ namespace Artemis.Core.Services
OnFinishedLoadedPlugins();
}
/// <inheritdoc />
public async Task ReloadPlugin(PluginInfo pluginInfo)
{
throw new NotImplementedException();
}
/// <inheritdoc />
public async Task<IModuleViewModel> GetModuleViewModel(PluginInfo pluginInfo)
{
return await pluginInfo.GetModuleViewModel(_kernel);
+2 -1
View File
@@ -43,7 +43,8 @@ namespace Artemis.Core.Services
await Task.Run(() =>
{
// TODO SpoinkyNL 8-1-18: Keep settings into account
Surface.LoadDevices(AsusDeviceProvider.Instance);
// This one doesn't work well without ASUS devices installed
// Surface.LoadDevices(AsusDeviceProvider.Instance);
Surface.LoadDevices(CoolerMasterDeviceProvider.Instance);
Surface.LoadDevices(CorsairDeviceProvider.Instance);
Surface.LoadDevices(DMXDeviceProvider.Instance);