Added module (the first major plugin type) view(model) creation

This commit is contained in:
SpoinkyNL committed 2018-01-08 20:41:21 +01:00
1 parent 8760b7f838
commit e43d632adb
26 files changed
+172 -1038

No files matched your search

@@ -2,8 +2,8 @@
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Artemis.Core.Events;
using Artemis.Core.Models;
using Artemis.Plugins.Interfaces;
using Artemis.Plugins.Models;
namespace Artemis.Core.Services.Interfaces
{
+6 -4
View File
@@ -6,9 +6,9 @@ using System.Linq;
using System.Threading.Tasks;
using Artemis.Core.Events;
using Artemis.Core.Exceptions;
using Artemis.Core.Models;
using Artemis.Core.Services.Interfaces;
using Artemis.Plugins.Interfaces;
using Artemis.Plugins.Models;
using CSScriptLibrary;
using Newtonsoft.Json;
using Ninject;
@@ -24,7 +24,7 @@ namespace Artemis.Core.Services
{
_kernel = kernel;
_plugins = new List<PluginInfo>();
if (!Directory.Exists(Constants.DataFolder + "plugins"))
Directory.CreateDirectory(Constants.DataFolder + "plugins");
}
@@ -66,9 +66,11 @@ namespace Artemis.Core.Services
throw new ArtemisPluginException(pluginInfo, "Cannot locate a view model for this plugin.");
// Instantiate the ViewModel with Ninject
return (IPluginViewModel) _kernel.Get(vmType);
var vm = (IPluginViewModel) _kernel.Get(vmType);
vm.PluginInfo = pluginInfo;
return vm;
}
public void Dispose()
{
}