mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Added module (the first major plugin type) view(model) creation
This commit is contained in:
1 parent
f7fe57676d
commit
3bea4463dc
26 files changed
+172
-1038
No files matched your search
@@ -1,9 +1,11 @@
|
||||
using Artemis.Plugins.Interfaces;
|
||||
using Artemis.Plugins.Models;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.Plugins.Abstract
|
||||
{
|
||||
public abstract class PluginViewModel : Screen, IPluginViewModel
|
||||
{
|
||||
public PluginInfo PluginInfo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,9 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ninject, Version=3.3.4.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Ninject.3.3.4\lib\net45\Ninject.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -47,11 +50,13 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Abstract\PluginViewModel.cs" />
|
||||
<Compile Include="Interfaces\IDataModelExpansion.cs" />
|
||||
<Compile Include="Interfaces\IDevice.cs" />
|
||||
<Compile Include="Interfaces\ILayerType.cs" />
|
||||
<Compile Include="Interfaces\IModule.cs" />
|
||||
<Compile Include="Interfaces\IPlugin.cs" />
|
||||
<Compile Include="Interfaces\IPluginViewModel.cs" />
|
||||
<Compile Include="Models\PluginInfo.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Artemis.Plugins.Interfaces
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Allows you to expand the application-wide datamodel
|
||||
/// </summary>
|
||||
public interface IDataModelExpansion : IPlugin
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace Artemis.Plugins.Interfaces
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Allows you to implement your own RGB device
|
||||
/// </summary>
|
||||
public interface IDevice : IPlugin
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace Artemis.Plugins.Interfaces
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Allows you to create your own layer type
|
||||
/// </summary>
|
||||
public interface ILayerType : IPlugin
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace Artemis.Plugins.Interfaces
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Allows you to add support for new games/applications
|
||||
/// </summary>
|
||||
public interface IModule : IPlugin
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Artemis.Plugins.Interfaces
|
||||
namespace Artemis.Plugins.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// This is the base plugin type, use the other interfaces such as IModule to create plugins
|
||||
/// </summary>
|
||||
public interface IPlugin
|
||||
{
|
||||
/// <summary>
|
||||
{/// <summary>
|
||||
/// Called when the plugin is loaded
|
||||
/// </summary>
|
||||
void LoadPlugin();
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
using Stylet;
|
||||
using Artemis.Plugins.Models;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.Plugins.Interfaces
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Allows you to create a view model for a plugin
|
||||
/// </summary>
|
||||
public interface IPluginViewModel : IScreen
|
||||
{
|
||||
PluginInfo PluginInfo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using Artemis.Plugins.Interfaces;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Artemis.Plugins.Models
|
||||
{
|
||||
public class PluginInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the plugin
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The version of the plugin
|
||||
/// </summary>
|
||||
public string Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The file implementing IPlugin, loaded on startup
|
||||
/// </summary>
|
||||
public string Main { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The file implementing IPluginViewModel, loaded when opened in the UI
|
||||
/// </summary>
|
||||
public string ViewModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The instantiated plugin, available after successful load
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public IPlugin Plugin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Full path to the plugin's current folder
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string Folder { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net46" />
|
||||
<package id="Ninject" version="3.3.4" targetFramework="net46" />
|
||||
<package id="Stylet" version="1.1.21" targetFramework="net46" />
|
||||
</packages>
|
||||
Reference in new issue
Block a user