diff --git a/src/Artemis.Core/Artemis.Core.csproj b/src/Artemis.Core/Artemis.Core.csproj index e1a2ea576..4e3c28780 100644 --- a/src/Artemis.Core/Artemis.Core.csproj +++ b/src/Artemis.Core/Artemis.Core.csproj @@ -9,10 +9,11 @@ Properties Artemis.Core Artemis.Core - v4.6 + v4.6.1 512 + true @@ -35,6 +36,9 @@ ..\packages\Castle.Core.4.2.1\lib\net45\Castle.Core.dll + + ..\packages\CS-Script.bin.3.28.2.0\lib\net46\CSScriptLibrary.dll + ..\packages\HidSharp.1.5\lib\net35\HidSharp.dll @@ -44,6 +48,42 @@ ..\packages\Microsoft.CodeAnalysis.CSharp.2.6.1\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll + + ..\packages\Microsoft.CodeAnalysis.CSharp.Scripting.2.6.1\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.Scripting.dll + + + ..\packages\Microsoft.CodeAnalysis.Scripting.Common.2.6.1\lib\netstandard1.3\Microsoft.CodeAnalysis.Scripting.dll + + + ..\packages\Microsoft.EntityFrameworkCore.2.0.2\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll + + + ..\packages\Microsoft.Extensions.Caching.Abstractions.2.0.1\lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll + + + ..\packages\Microsoft.Extensions.Caching.Memory.2.0.1\lib\netstandard2.0\Microsoft.Extensions.Caching.Memory.dll + + + ..\packages\Microsoft.Extensions.DependencyInjection.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.dll + + + ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + ..\packages\Microsoft.Extensions.Logging.2.0.1\lib\netstandard2.0\Microsoft.Extensions.Logging.dll + + + ..\packages\Microsoft.Extensions.Logging.Abstractions.2.0.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll + + + ..\packages\Microsoft.Extensions.Options.2.0.1\lib\netstandard2.0\Microsoft.Extensions.Options.dll + + + ..\packages\Microsoft.Extensions.Primitives.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll + + + ..\packages\CS-Script.bin.3.28.2.0\lib\net46\Mono.CSharp.dll + ..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll @@ -56,47 +96,50 @@ ..\packages\Ninject.Extensions.Factory.3.3.2\lib\net45\Ninject.Extensions.Factory.dll + + ..\packages\Remotion.Linq.2.1.1\lib\net45\Remotion.Linq.dll + - ..\packages\RGB.NET.Brushes.0.0.1.38\lib\net45\RGB.NET.Brushes.dll + ..\packages\RGB.NET.Brushes.0.0.1.48\lib\net45\RGB.NET.Brushes.dll - ..\packages\RGB.NET.Core.0.0.1.38\lib\net45\RGB.NET.Core.dll + ..\packages\RGB.NET.Core.0.0.1.48\lib\net45\RGB.NET.Core.dll - ..\packages\RGB.NET.Decorators.0.0.1.38\lib\net45\RGB.NET.Decorators.dll + ..\packages\RGB.NET.Decorators.0.0.1.48\lib\net45\RGB.NET.Decorators.dll - ..\packages\RGB.NET.Devices.Asus.0.0.1.38\lib\net45\RGB.NET.Devices.Asus.dll + ..\packages\RGB.NET.Devices.Asus.0.0.1.48\lib\net45\RGB.NET.Devices.Asus.dll - ..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.38\lib\net45\RGB.NET.Devices.CoolerMaster.dll + ..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.48\lib\net45\RGB.NET.Devices.CoolerMaster.dll - ..\packages\RGB.NET.Devices.Corsair.0.0.1.38\lib\net45\RGB.NET.Devices.Corsair.dll + ..\packages\RGB.NET.Devices.Corsair.0.0.1.48\lib\net45\RGB.NET.Devices.Corsair.dll - ..\packages\RGB.NET.Devices.DMX.0.0.1.38\lib\net45\RGB.NET.Devices.DMX.dll + ..\packages\RGB.NET.Devices.DMX.0.0.1.48\lib\net45\RGB.NET.Devices.DMX.dll - ..\packages\RGB.NET.Devices.Logitech.0.0.1.38\lib\net45\RGB.NET.Devices.Logitech.dll + ..\packages\RGB.NET.Devices.Logitech.0.0.1.48\lib\net45\RGB.NET.Devices.Logitech.dll ..\packages\RGB.NET.Devices.Msi.0.0.1.38\lib\net45\RGB.NET.Devices.Msi.dll - ..\packages\RGB.NET.Devices.Novation.0.0.1.38\lib\net45\RGB.NET.Devices.Novation.dll + ..\packages\RGB.NET.Devices.Novation.0.0.1.48\lib\net45\RGB.NET.Devices.Novation.dll - ..\packages\RGB.NET.Devices.Razer.0.0.1.38\lib\net45\RGB.NET.Devices.Razer.dll + ..\packages\RGB.NET.Devices.Razer.0.0.1.48\lib\net45\RGB.NET.Devices.Razer.dll - ..\packages\RGB.NET.Groups.0.0.1.38\lib\net45\RGB.NET.Groups.dll + ..\packages\RGB.NET.Groups.0.0.1.48\lib\net45\RGB.NET.Groups.dll ..\packages\RGB.NET.Input.0.0.1.38\lib\net45\RGB.NET.Input.dll - ..\packages\RGB.NET.Input.Corsair.0.0.1.38\lib\net45\RGB.NET.Input.Corsair.dll + ..\packages\RGB.NET.Input.Corsair.0.0.1.42\lib\net45\RGB.NET.Input.Corsair.dll ..\packages\Sanford.Multimedia.Midi.6.6.0\lib\net20\Sanford.Multimedia.Midi.dll @@ -110,19 +153,32 @@ True - ..\packages\System.Collections.Immutable.1.4.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + ..\packages\System.Collections.Immutable.1.4.0\lib\netstandard2.0\System.Collections.Immutable.dll + + + ..\packages\System.ComponentModel.Annotations.4.4.0\lib\net461\System.ComponentModel.Annotations.dll + ..\packages\System.Console.4.3.0\lib\net46\System.Console.dll + True + + ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll + ..\packages\System.Diagnostics.FileVersionInfo.4.3.0\lib\net46\System.Diagnostics.FileVersionInfo.dll + True ..\packages\System.Diagnostics.StackTrace.4.3.0\lib\net46\System.Diagnostics.StackTrace.dll + True + + + ..\packages\System.Interactive.Async.3.1.1\lib\net46\System.Interactive.Async.dll ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll @@ -130,36 +186,45 @@ ..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll + True ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll + True - ..\packages\System.Reflection.Metadata.1.5.0\lib\portable-net45+win8\System.Reflection.Metadata.dll + ..\packages\System.Reflection.Metadata.1.5.0\lib\netstandard2.0\System.Reflection.Metadata.dll - - ..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net46\System.Security.Cryptography.Algorithms.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net461\System.Security.Cryptography.Algorithms.dll True ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + True ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll - - - ..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net46\System.Security.Cryptography.X509Certificates.dll True - - ..\packages\System.Text.Encoding.CodePages.4.4.0\lib\net46\System.Text.Encoding.CodePages.dll + + ..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll + True + + + ..\packages\System.Text.Encoding.CodePages.4.4.0\lib\net461\System.Text.Encoding.CodePages.dll ..\packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll + True - ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll + ..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll + True @@ -169,15 +234,19 @@ ..\packages\System.Xml.ReaderWriter.4.3.1\lib\net46\System.Xml.ReaderWriter.dll + True ..\packages\System.Xml.XmlDocument.4.3.0\lib\net46\System.Xml.XmlDocument.dll + True ..\packages\System.Xml.XPath.4.3.0\lib\net46\System.Xml.XPath.dll + True ..\packages\System.Xml.XPath.XDocument.4.3.0\lib\net46\System.Xml.XPath.XDocument.dll + True @@ -185,10 +254,21 @@ - + + + + + + + + + + + + @@ -202,38 +282,28 @@ + - - {cd23bc5e-57f0-46ce-a007-24d031146219} - Artemis.Plugins + + {E489E5E3-1A65-4AF5-A1EA-F9805FD19A65} + Artemis.Storage - - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - \ No newline at end of file diff --git a/src/Artemis.Core/Events/PluginEventArgs.cs b/src/Artemis.Core/Events/PluginEventArgs.cs index cc874c699..81647cde4 100644 --- a/src/Artemis.Core/Events/PluginEventArgs.cs +++ b/src/Artemis.Core/Events/PluginEventArgs.cs @@ -1,5 +1,5 @@ using System; -using Artemis.Plugins.Models; +using Artemis.Core.Plugins.Models; namespace Artemis.Core.Events { diff --git a/src/Artemis.Core/Ninject/CoreModule.cs b/src/Artemis.Core/Ninject/CoreModule.cs index 6b1c062c2..027fe7320 100644 --- a/src/Artemis.Core/Ninject/CoreModule.cs +++ b/src/Artemis.Core/Ninject/CoreModule.cs @@ -1,4 +1,5 @@ using Artemis.Core.Services.Interfaces; +using Artemis.Storage; using Ninject.Extensions.Conventions; using Ninject.Modules; @@ -17,6 +18,8 @@ namespace Artemis.Core.Ninject .BindAllInterfaces() .Configure(c => c.InSingletonScope()); }); + + Bind().ToSelf().InSingletonScope(); } } } \ No newline at end of file diff --git a/src/Artemis.Plugins/Abstract/ModuleViewModel.cs b/src/Artemis.Core/Plugins/Abstract/ModuleViewModel.cs similarity index 56% rename from src/Artemis.Plugins/Abstract/ModuleViewModel.cs rename to src/Artemis.Core/Plugins/Abstract/ModuleViewModel.cs index 338f9f911..0546b23a8 100644 --- a/src/Artemis.Plugins/Abstract/ModuleViewModel.cs +++ b/src/Artemis.Core/Plugins/Abstract/ModuleViewModel.cs @@ -1,8 +1,8 @@ -using Artemis.Plugins.Interfaces; -using Artemis.Plugins.Models; +using Artemis.Core.Plugins.Interfaces; +using Artemis.Core.Plugins.Models; using Stylet; -namespace Artemis.Plugins.Abstract +namespace Artemis.Core.Plugins.Abstract { public abstract class ModuleViewModel : Screen, IModuleViewModel { diff --git a/src/Artemis.Plugins/Abstract/ProfileModule.cs b/src/Artemis.Core/Plugins/Abstract/ProfileModule.cs similarity index 82% rename from src/Artemis.Plugins/Abstract/ProfileModule.cs rename to src/Artemis.Core/Plugins/Abstract/ProfileModule.cs index 115fdc30c..f7c16eeda 100644 --- a/src/Artemis.Plugins/Abstract/ProfileModule.cs +++ b/src/Artemis.Core/Plugins/Abstract/ProfileModule.cs @@ -1,7 +1,7 @@ using System; -using Artemis.Plugins.Interfaces; +using Artemis.Core.Plugins.Interfaces; -namespace Artemis.Plugins.Abstract +namespace Artemis.Core.Plugins.Abstract { public abstract class ProfileModule : IModule { @@ -17,12 +17,6 @@ namespace Artemis.Plugins.Abstract // Load and activate the last active profile } - /// - public void UnloadPlugin() - { - // Unload the last active profile - } - /// public virtual void Update(double deltaTime) { @@ -34,5 +28,10 @@ namespace Artemis.Plugins.Abstract { // Render the profile } + + /// + public void Dispose() + { + } } } \ No newline at end of file diff --git a/src/Artemis.Core/Exceptions/ArtemisPluginException.cs b/src/Artemis.Core/Plugins/Exceptions/ArtemisPluginException.cs similarity index 88% rename from src/Artemis.Core/Exceptions/ArtemisPluginException.cs rename to src/Artemis.Core/Plugins/Exceptions/ArtemisPluginException.cs index a2c96d709..3d0a0917b 100644 --- a/src/Artemis.Core/Exceptions/ArtemisPluginException.cs +++ b/src/Artemis.Core/Plugins/Exceptions/ArtemisPluginException.cs @@ -1,7 +1,7 @@ using System; -using Artemis.Plugins.Models; +using Artemis.Core.Plugins.Models; -namespace Artemis.Core.Exceptions +namespace Artemis.Core.Plugins.Exceptions { public class ArtemisPluginException : Exception { diff --git a/src/Artemis.Plugins/Interfaces/IDataModelExpansion.cs b/src/Artemis.Core/Plugins/Interfaces/IDataModelExpansion.cs similarity index 83% rename from src/Artemis.Plugins/Interfaces/IDataModelExpansion.cs rename to src/Artemis.Core/Plugins/Interfaces/IDataModelExpansion.cs index eac2f63da..f7fdd593a 100644 --- a/src/Artemis.Plugins/Interfaces/IDataModelExpansion.cs +++ b/src/Artemis.Core/Plugins/Interfaces/IDataModelExpansion.cs @@ -1,4 +1,4 @@ -namespace Artemis.Plugins.Interfaces +namespace Artemis.Core.Plugins.Interfaces { /// /// diff --git a/src/Artemis.Plugins/Interfaces/IDevice.cs b/src/Artemis.Core/Plugins/Interfaces/IDevice.cs similarity index 79% rename from src/Artemis.Plugins/Interfaces/IDevice.cs rename to src/Artemis.Core/Plugins/Interfaces/IDevice.cs index b40566156..47ae0c773 100644 --- a/src/Artemis.Plugins/Interfaces/IDevice.cs +++ b/src/Artemis.Core/Plugins/Interfaces/IDevice.cs @@ -1,4 +1,4 @@ -namespace Artemis.Plugins.Interfaces +namespace Artemis.Core.Plugins.Interfaces { /// /// diff --git a/src/Artemis.Core/Plugins/Interfaces/ILayerType.cs b/src/Artemis.Core/Plugins/Interfaces/ILayerType.cs new file mode 100644 index 000000000..c7f9b29d3 --- /dev/null +++ b/src/Artemis.Core/Plugins/Interfaces/ILayerType.cs @@ -0,0 +1,25 @@ +using Artemis.Core.ProfileElements; +using RGB.NET.Core; + +namespace Artemis.Core.Plugins.Interfaces +{ + /// + /// + /// Allows you to create your own layer type + /// + public interface ILayerType : IPlugin + { + /// + /// Updates the layer type + /// + /// + void Update(Layer layer); + + /// + /// Renders the layer type + /// + void Render(Layer device, IRGBDevice rgbDevice); + + ILayerType ApplyToLayer(Layer layer); + } +} \ No newline at end of file diff --git a/src/Artemis.Plugins/Interfaces/IModule.cs b/src/Artemis.Core/Plugins/Interfaces/IModule.cs similarity index 96% rename from src/Artemis.Plugins/Interfaces/IModule.cs rename to src/Artemis.Core/Plugins/Interfaces/IModule.cs index ac96898c3..ebb3e5e91 100644 --- a/src/Artemis.Plugins/Interfaces/IModule.cs +++ b/src/Artemis.Core/Plugins/Interfaces/IModule.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Plugins.Interfaces +namespace Artemis.Core.Plugins.Interfaces { /// /// diff --git a/src/Artemis.Plugins/Interfaces/IModuleDataModel.cs b/src/Artemis.Core/Plugins/Interfaces/IModuleDataModel.cs similarity index 54% rename from src/Artemis.Plugins/Interfaces/IModuleDataModel.cs rename to src/Artemis.Core/Plugins/Interfaces/IModuleDataModel.cs index 534d5b9f2..adeae8664 100644 --- a/src/Artemis.Plugins/Interfaces/IModuleDataModel.cs +++ b/src/Artemis.Core/Plugins/Interfaces/IModuleDataModel.cs @@ -1,4 +1,4 @@ -namespace Artemis.Plugins.Interfaces +namespace Artemis.Core.Plugins.Interfaces { public interface IModuleDataModel { diff --git a/src/Artemis.Plugins/Interfaces/IModuleViewModel.cs b/src/Artemis.Core/Plugins/Interfaces/IModuleViewModel.cs similarity index 75% rename from src/Artemis.Plugins/Interfaces/IModuleViewModel.cs rename to src/Artemis.Core/Plugins/Interfaces/IModuleViewModel.cs index 83ef20391..2035567a7 100644 --- a/src/Artemis.Plugins/Interfaces/IModuleViewModel.cs +++ b/src/Artemis.Core/Plugins/Interfaces/IModuleViewModel.cs @@ -1,7 +1,7 @@ -using Artemis.Plugins.Models; +using Artemis.Core.Plugins.Models; using Stylet; -namespace Artemis.Plugins.Interfaces +namespace Artemis.Core.Plugins.Interfaces { /// /// diff --git a/src/Artemis.Plugins/Interfaces/IPlugin.cs b/src/Artemis.Core/Plugins/Interfaces/IPlugin.cs similarity index 58% rename from src/Artemis.Plugins/Interfaces/IPlugin.cs rename to src/Artemis.Core/Plugins/Interfaces/IPlugin.cs index fc923e8ae..f9ef4fd99 100644 --- a/src/Artemis.Plugins/Interfaces/IPlugin.cs +++ b/src/Artemis.Core/Plugins/Interfaces/IPlugin.cs @@ -1,18 +1,15 @@ -namespace Artemis.Plugins.Interfaces +using System; + +namespace Artemis.Core.Plugins.Interfaces { /// /// This is the base plugin type, use the other interfaces such as IModule to create plugins /// - public interface IPlugin + public interface IPlugin : IDisposable { /// /// Called when the plugin is loaded /// void LoadPlugin(); - - /// - /// Called when the plugin is unloaded - /// - void UnloadPlugin(); } } \ No newline at end of file diff --git a/src/Artemis.Plugins/Models/PluginInfo.cs b/src/Artemis.Core/Plugins/Models/PluginInfo.cs similarity index 93% rename from src/Artemis.Plugins/Models/PluginInfo.cs rename to src/Artemis.Core/Plugins/Models/PluginInfo.cs index e59d67600..332c0cd71 100644 --- a/src/Artemis.Plugins/Models/PluginInfo.cs +++ b/src/Artemis.Core/Plugins/Models/PluginInfo.cs @@ -1,19 +1,25 @@ -using System.IO; +using System; +using System.IO; using System.Linq; using System.Reflection; using System.Threading.Tasks; -using Artemis.Plugins.Exceptions; -using Artemis.Plugins.Interfaces; +using Artemis.Core.Plugins.Exceptions; +using Artemis.Core.Plugins.Interfaces; using CSScriptLibrary; using Newtonsoft.Json; using Ninject; -namespace Artemis.Plugins.Models +namespace Artemis.Core.Plugins.Models { public class PluginInfo { private static Assembly _assembly; + /// + /// The plugin's GUID + /// + public Guid Guid { get; set; } + /// /// The name of the plugin /// @@ -46,7 +52,7 @@ namespace Artemis.Plugins.Models /// public void UnloadPlugin() { - Plugin.UnloadPlugin(); + Plugin.Dispose(); _assembly = null; } diff --git a/src/Artemis.Core/ProfileElements/Folder.cs b/src/Artemis.Core/ProfileElements/Folder.cs index 370b3cae3..f4afb3d84 100644 --- a/src/Artemis.Core/ProfileElements/Folder.cs +++ b/src/Artemis.Core/ProfileElements/Folder.cs @@ -1,23 +1,52 @@ using System.Collections.Generic; using Artemis.Core.ProfileElements.Interfaces; +using Artemis.Core.Services.Interfaces; +using Artemis.Storage.Entities; using RGB.NET.Core; namespace Artemis.Core.ProfileElements { public class Folder : IProfileElement { + public Folder() + { + Children = new List(); + } + public List Children { get; set; } + public int Order { get; set; } + public string Name { get; set; } public void Update() { + // Folders don't update but their children do foreach (var profileElement in Children) profileElement.Update(); } public void Render(IRGBDevice rgbDevice) { + // Folders don't render but their children do foreach (var profileElement in Children) profileElement.Render(rgbDevice); } + + public static Folder FromFolderEntity(FolderEntity folderEntity, IPluginService pluginService) + { + var folder = new Folder + { + Name = folderEntity.Name, + Order = folderEntity.Order + }; + + // Load child folders + foreach (var childFolder in folderEntity.Folders) + folder.Children.Add(FromFolderEntity(childFolder, pluginService)); + // Load child layers + foreach (var childLayer in folderEntity.Layers) + folder.Children.Add(Layer.FromLayerEntity(childLayer, pluginService)); + + return folder; + } } } \ No newline at end of file diff --git a/src/Artemis.Core/ProfileElements/Interfaces/IProfileElement.cs b/src/Artemis.Core/ProfileElements/Interfaces/IProfileElement.cs index 3b6886013..7493c4c28 100644 --- a/src/Artemis.Core/ProfileElements/Interfaces/IProfileElement.cs +++ b/src/Artemis.Core/ProfileElements/Interfaces/IProfileElement.cs @@ -10,6 +10,16 @@ namespace Artemis.Core.ProfileElements.Interfaces /// List Children { get; set; } + /// + /// The order in which this element appears in the update loop and editor + /// + int Order { get; set; } + + /// + /// The name which appears in the editor + /// + string Name { get; set; } + /// /// Updates the element /// diff --git a/src/Artemis.Core/ProfileElements/Layer.cs b/src/Artemis.Core/ProfileElements/Layer.cs new file mode 100644 index 000000000..f05e4b0f5 --- /dev/null +++ b/src/Artemis.Core/ProfileElements/Layer.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using Artemis.Core.Plugins.Interfaces; +using Artemis.Core.ProfileElements.Interfaces; +using Artemis.Core.Services.Interfaces; +using Artemis.Storage.Entities; +using RGB.NET.Core; + +namespace Artemis.Core.ProfileElements +{ + public class Layer : IProfileElement + { + public Layer() + { + Children = new List(); + } + + public ILayerType LayerType { get; private set; } + + public List Children { get; set; } + public int Order { get; set; } + public string Name { get; set; } + + public void Update() + { + if (LayerType == null) + return; + + lock (LayerType) + { + LayerType.Update(this); + } + } + + public void Render(IRGBDevice rgbDevice) + { + if (LayerType == null) + return; + + lock (LayerType) + { + LayerType.Render(this, rgbDevice); + } + } + + public static Layer FromLayerEntity(LayerEntity layerEntity, IPluginService pluginService) + { + var layer = new Layer + { + Name = layerEntity.Name, + Order = layerEntity.Order, + LayerType = pluginService.GetLayerTypeByGuid(Guid.Parse(layerEntity.Guid)) + }; + + return layer; + } + + public void UpdateLayerType(ILayerType layerType) + { + if (LayerType != null) + { + lock (LayerType) + { + LayerType.Dispose(); + } + } + + LayerType = layerType; + } + } +} \ No newline at end of file diff --git a/src/Artemis.Core/ProfileElements/Profile.cs b/src/Artemis.Core/ProfileElements/Profile.cs index a463fac81..a79ec0bf6 100644 --- a/src/Artemis.Core/ProfileElements/Profile.cs +++ b/src/Artemis.Core/ProfileElements/Profile.cs @@ -1,15 +1,28 @@ using System.Collections.Generic; +using Artemis.Core.Plugins.Models; using Artemis.Core.ProfileElements.Interfaces; +using Artemis.Core.Services.Interfaces; +using Artemis.Storage.Entities; using RGB.NET.Core; namespace Artemis.Core.ProfileElements { public class Profile : IProfileElement { + private Profile(PluginInfo pluginInfo) + { + PluginInfo = pluginInfo; + } + + public int Order { get; set; } + public string Name { get; set; } + public PluginInfo PluginInfo { get; } public List Children { get; set; } public void Update() { + foreach (var profileElement in Children) + profileElement.Update(); } public void Render(IRGBDevice rgbDevice) @@ -17,5 +30,15 @@ namespace Artemis.Core.ProfileElements foreach (var profileElement in Children) profileElement.Render(rgbDevice); } + + public static Profile FromProfileEntity(PluginInfo pluginInfo, ProfileEntity profileEntity, IPluginService pluginService) + { + var profile = new Profile(pluginInfo) {Name = profileEntity.Name}; + + // Populate the profile starting at the root, the rest is populated recursively + profile.Children.Add(Folder.FromFolderEntity(profileEntity.RootFolder, pluginService)); + + return profile; + } } } \ No newline at end of file diff --git a/src/Artemis.Core/Services/CoreService.cs b/src/Artemis.Core/Services/CoreService.cs index 7c33b412c..f776eedf5 100644 --- a/src/Artemis.Core/Services/CoreService.cs +++ b/src/Artemis.Core/Services/CoreService.cs @@ -2,8 +2,8 @@ using System.Linq; using System.Threading.Tasks; using Artemis.Core.Exceptions; +using Artemis.Core.Plugins.Interfaces; using Artemis.Core.Services.Interfaces; -using Artemis.Plugins.Interfaces; using RGB.NET.Core; namespace Artemis.Core.Services diff --git a/src/Artemis.Core/Services/Interfaces/IMainDataModelService.cs b/src/Artemis.Core/Services/Interfaces/IMainDataModelService.cs index 4a0de162d..684f048b9 100644 --- a/src/Artemis.Core/Services/Interfaces/IMainDataModelService.cs +++ b/src/Artemis.Core/Services/Interfaces/IMainDataModelService.cs @@ -1,5 +1,5 @@ using Artemis.Core.Models; -using Artemis.Plugins.Interfaces; +using Artemis.Core.Plugins.Interfaces; namespace Artemis.Core.Services.Interfaces { diff --git a/src/Artemis.Core/Services/Interfaces/IPluginService.cs b/src/Artemis.Core/Services/Interfaces/IPluginService.cs index f174f00bd..112942dd3 100644 --- a/src/Artemis.Core/Services/Interfaces/IPluginService.cs +++ b/src/Artemis.Core/Services/Interfaces/IPluginService.cs @@ -2,8 +2,9 @@ using System.Collections.ObjectModel; using System.Threading.Tasks; using Artemis.Core.Events; -using Artemis.Plugins.Interfaces; -using Artemis.Plugins.Models; +using Artemis.Core.Plugins.Interfaces; +using Artemis.Core.Plugins.Models; +using Artemis.Core.ProfileElements; namespace Artemis.Core.Services.Interfaces { @@ -55,5 +56,12 @@ namespace Artemis.Core.Services.Interfaces /// Occurs when loading all plugins has finished /// event EventHandler FinishedLoadedPlugins; + + /// + /// If found, returns an instance of the layer type matching the given GUID + /// + /// The GUID of the layer type to find + /// An instance of the layer type + ILayerType GetLayerTypeByGuid(Guid layerTypeGuid); } } \ No newline at end of file diff --git a/src/Artemis.Core/Services/MainDataModelService.cs b/src/Artemis.Core/Services/MainDataModelService.cs index 905f2530f..4c3d2366e 100644 --- a/src/Artemis.Core/Services/MainDataModelService.cs +++ b/src/Artemis.Core/Services/MainDataModelService.cs @@ -2,8 +2,8 @@ using System.Collections.ObjectModel; using Artemis.Core.Exceptions; using Artemis.Core.Models; +using Artemis.Core.Plugins.Interfaces; using Artemis.Core.Services.Interfaces; -using Artemis.Plugins.Interfaces; namespace Artemis.Core.Services { diff --git a/src/Artemis.Core/Services/PluginService.cs b/src/Artemis.Core/Services/PluginService.cs index d4e21e79b..7ff2f83e7 100644 --- a/src/Artemis.Core/Services/PluginService.cs +++ b/src/Artemis.Core/Services/PluginService.cs @@ -2,12 +2,15 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; +using System.Linq; using System.Threading.Tasks; using Artemis.Core.Events; using Artemis.Core.Exceptions; +using Artemis.Core.Plugins.Exceptions; +using Artemis.Core.Plugins.Interfaces; +using Artemis.Core.Plugins.Models; +using Artemis.Core.ProfileElements; using Artemis.Core.Services.Interfaces; -using Artemis.Plugins.Interfaces; -using Artemis.Plugins.Models; using Ninject; namespace Artemis.Core.Services @@ -64,6 +67,22 @@ namespace Artemis.Core.Services return await Task.Run(() => pluginInfo.GetModuleViewModel(_kernel)); } + /// + public ILayerType GetLayerTypeByGuid(Guid layerTypeGuid) + { + var pluginInfo = _plugins.FirstOrDefault(p => p.Guid == layerTypeGuid); + if (pluginInfo == null) + return null; + + // Layer types are instantiated per layer so lets compile and return a new instance + if (!(pluginInfo.Plugin is ILayerType)) + { + throw new ArtemisPluginException(pluginInfo, "Plugin is expected to implement ILayerType"); + } + + return (ILayerType) pluginInfo.Plugin; + } + public void Dispose() { // Empty the list of plugins diff --git a/src/Artemis.Core/Services/StorageService.cs b/src/Artemis.Core/Services/StorageService.cs new file mode 100644 index 000000000..ae40ecfba --- /dev/null +++ b/src/Artemis.Core/Services/StorageService.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Artemis.Core.Plugins.Models; +using Artemis.Core.ProfileElements; +using Artemis.Core.Services.Interfaces; +using Artemis.Storage; +using Microsoft.EntityFrameworkCore; + +namespace Artemis.Core.Services +{ + public class StorageService : IStorageService + { + private readonly StorageContext _dbContext; + private readonly IPluginService _pluginService; + + public StorageService(StorageContext dbContext, IPluginService pluginService) + { + _dbContext = dbContext; + _pluginService = pluginService; + } + + public async Task> GetModuleProfiles(PluginInfo pluginInfo) + { + var profileEntities = await _dbContext.Profiles.Where(p => p.PluginGuid == pluginInfo.Guid).ToListAsync(); + var profiles = new List(); + foreach (var profileEntity in profileEntities) + profiles.Add(Profile.FromProfileEntity(pluginInfo, profileEntity, _pluginService)); + + return profiles; + } + + public async Task SaveProfile(Profile profile) + { + // Find a matching profile entity to update + + // If not found, create a new one + + await _dbContext.SaveChangesAsync(); + } + } + + public interface IStorageService + { + Task> GetModuleProfiles(PluginInfo pluginInfo); + } +} \ No newline at end of file diff --git a/src/Artemis.Core/app.config b/src/Artemis.Core/app.config index dd61acf51..605f36b95 100644 --- a/src/Artemis.Core/app.config +++ b/src/Artemis.Core/app.config @@ -1,5 +1,4 @@  - @@ -17,7 +16,7 @@ - + @@ -28,8 +27,7 @@ - + @@ -53,8 +51,7 @@ - + @@ -69,6 +66,14 @@ + + + + + + + + - \ No newline at end of file + diff --git a/src/Artemis.Core/packages.config b/src/Artemis.Core/packages.config index 28b222ef4..30507053e 100644 --- a/src/Artemis.Core/packages.config +++ b/src/Artemis.Core/packages.config @@ -1,74 +1,92 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.Plugins.BuiltIn/Artemis.Plugins.BuiltIn.csproj b/src/Artemis.Plugins.BuiltIn/Artemis.Plugins.BuiltIn.csproj index 3d5ab2cbb..7cec15d25 100644 --- a/src/Artemis.Plugins.BuiltIn/Artemis.Plugins.BuiltIn.csproj +++ b/src/Artemis.Plugins.BuiltIn/Artemis.Plugins.BuiltIn.csproj @@ -33,11 +33,17 @@ + + ..\packages\RGB.NET.Core.0.0.1.48\lib\net45\RGB.NET.Core.dll + ..\packages\Stylet.1.1.21\lib\net45\Stylet.dll + + ..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll + @@ -69,10 +75,6 @@ {9B811F9B-86B9-4771-87AF-72BAE7078A36} Artemis.Core - - {CD23BC5E-57F0-46CE-A007-24D031146219} - Artemis.Plugins - \ No newline at end of file diff --git a/src/Artemis.Plugins.BuiltIn/Modules/General/GeneralDataModel.cs b/src/Artemis.Plugins.BuiltIn/Modules/General/GeneralDataModel.cs index b619f8864..28988381a 100644 --- a/src/Artemis.Plugins.BuiltIn/Modules/General/GeneralDataModel.cs +++ b/src/Artemis.Plugins.BuiltIn/Modules/General/GeneralDataModel.cs @@ -1,5 +1,5 @@ using Artemis.Core.Attributes; -using Artemis.Plugins.Interfaces; +using Artemis.Core.Plugins.Interfaces; namespace Artemis.Plugins.BuiltIn.Modules.General { diff --git a/src/Artemis.Plugins.BuiltIn/Modules/General/GeneralModule.cs b/src/Artemis.Plugins.BuiltIn/Modules/General/GeneralModule.cs index 4a96c63cf..bf4f9e69e 100644 --- a/src/Artemis.Plugins.BuiltIn/Modules/General/GeneralModule.cs +++ b/src/Artemis.Plugins.BuiltIn/Modules/General/GeneralModule.cs @@ -2,12 +2,25 @@ //css_inc GeneralDataModel.cs; using System; -using Artemis.Plugins.Abstract; +using Artemis.Core.Plugins.Abstract; +using Artemis.Core.Services.Interfaces; +using RGB.NET.Core; namespace Artemis.Plugins.BuiltIn.Modules.General { public class GeneralModule : ProfileModule { + private readonly IRgbService _rgbService; + private RGBSurface _surface; + + public GeneralModule(IRgbService rgbService) + { + _rgbService = rgbService; + _surface = _rgbService.Surface; + + + } + public override Type ViewModelType { get { return typeof(GeneralViewModel); } diff --git a/src/Artemis.Plugins.BuiltIn/Modules/General/GeneralViewModel.cs b/src/Artemis.Plugins.BuiltIn/Modules/General/GeneralViewModel.cs index 2ffef9bf5..f3fbd9c86 100644 --- a/src/Artemis.Plugins.BuiltIn/Modules/General/GeneralViewModel.cs +++ b/src/Artemis.Plugins.BuiltIn/Modules/General/GeneralViewModel.cs @@ -1,5 +1,5 @@ -using Artemis.Plugins.Interfaces; -using Artemis.Plugins.Models; +using Artemis.Core.Plugins.Interfaces; +using Artemis.Core.Plugins.Models; using Stylet; namespace Artemis.Plugins.BuiltIn.Modules.General diff --git a/src/Artemis.Plugins.BuiltIn/app.config b/src/Artemis.Plugins.BuiltIn/app.config index 5b3e7dfff..547ac4d3e 100644 --- a/src/Artemis.Plugins.BuiltIn/app.config +++ b/src/Artemis.Plugins.BuiltIn/app.config @@ -9,15 +9,14 @@ - + - + @@ -61,14 +60,21 @@ - + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.Plugins.BuiltIn/packages.config b/src/Artemis.Plugins.BuiltIn/packages.config index 79b339dec..553a252cf 100644 --- a/src/Artemis.Plugins.BuiltIn/packages.config +++ b/src/Artemis.Plugins.BuiltIn/packages.config @@ -1,5 +1,6 @@  - + + \ No newline at end of file diff --git a/src/Artemis.Plugins/Artemis.Plugins.csproj b/src/Artemis.Plugins/Artemis.Plugins.csproj index 0ac24fc04..7868f6c86 100644 --- a/src/Artemis.Plugins/Artemis.Plugins.csproj +++ b/src/Artemis.Plugins/Artemis.Plugins.csproj @@ -9,10 +9,11 @@ Properties Artemis.Plugins Artemis.Plugins - v4.6 + v4.6.1 512 + true @@ -56,6 +57,9 @@ ..\packages\Ninject.3.3.4\lib\net45\Ninject.dll + + ..\packages\RGB.NET.Core.0.0.1.38\lib\net45\RGB.NET.Core.dll + ..\packages\Stylet.1.1.21\lib\net45\Stylet.dll @@ -113,8 +117,8 @@ ..\packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll - - ..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll + + ..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll @@ -136,17 +140,6 @@ - - - - - - - - - - - @@ -157,5 +150,11 @@ + + + + + + \ No newline at end of file diff --git a/src/Artemis.Plugins/Exceptions/ArtemisPluginException.cs b/src/Artemis.Plugins/Exceptions/ArtemisPluginException.cs deleted file mode 100644 index 7a56fd56d..000000000 --- a/src/Artemis.Plugins/Exceptions/ArtemisPluginException.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using Artemis.Plugins.Models; - -namespace Artemis.Plugins.Exceptions -{ - public class ArtemisPluginException : Exception - { - public ArtemisPluginException(PluginInfo pluginInfo) - { - PluginInfo = pluginInfo; - } - - public ArtemisPluginException(PluginInfo pluginInfo, string message) : base(message) - { - PluginInfo = pluginInfo; - } - - public ArtemisPluginException(PluginInfo pluginInfo, string message, Exception inner) : base(message, inner) - { - PluginInfo = pluginInfo; - } - - public PluginInfo PluginInfo { get; } - } -} \ No newline at end of file diff --git a/src/Artemis.Plugins/Interfaces/ILayerType.cs b/src/Artemis.Plugins/Interfaces/ILayerType.cs deleted file mode 100644 index 1a06bc0ea..000000000 --- a/src/Artemis.Plugins/Interfaces/ILayerType.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Artemis.Plugins.Interfaces -{ - /// - /// - /// Allows you to create your own layer type - /// - public interface ILayerType : IPlugin - { - } -} \ No newline at end of file diff --git a/src/Artemis.Plugins/app.config b/src/Artemis.Plugins/app.config index 5c210d0c2..794ce2453 100644 --- a/src/Artemis.Plugins/app.config +++ b/src/Artemis.Plugins/app.config @@ -1,5 +1,4 @@  - @@ -20,8 +19,7 @@ - + @@ -45,14 +43,17 @@ - + + + + + - \ No newline at end of file + diff --git a/src/Artemis.Plugins/packages.config b/src/Artemis.Plugins/packages.config index a0ab7c1fc..0442c21db 100644 --- a/src/Artemis.Plugins/packages.config +++ b/src/Artemis.Plugins/packages.config @@ -1,5 +1,4 @@  - @@ -10,6 +9,7 @@ + @@ -36,10 +36,10 @@ - + - + @@ -47,7 +47,7 @@ - + diff --git a/src/Artemis.Storage/Artemis.Storage.csproj b/src/Artemis.Storage/Artemis.Storage.csproj index 40afd4843..68559c83e 100644 --- a/src/Artemis.Storage/Artemis.Storage.csproj +++ b/src/Artemis.Storage/Artemis.Storage.csproj @@ -8,8 +8,9 @@ - - + + + diff --git a/src/Artemis.Storage/Entities/FolderEntity.cs b/src/Artemis.Storage/Entities/FolderEntity.cs index 76cf0d292..1beb882f4 100644 --- a/src/Artemis.Storage/Entities/FolderEntity.cs +++ b/src/Artemis.Storage/Entities/FolderEntity.cs @@ -5,10 +5,10 @@ using System.ComponentModel.DataAnnotations.Schema; namespace Artemis.Storage.Entities { [Table("Folders")] - internal class FolderEntity + public class FolderEntity { [Key] - public int Id { get; set; } + public string Guid { get; set; } public int Order { get; set; } public string Name { get; set; } diff --git a/src/Artemis.Storage/Entities/KeypointEntity.cs b/src/Artemis.Storage/Entities/KeypointEntity.cs index dde39792d..5ef4a7cf9 100644 --- a/src/Artemis.Storage/Entities/KeypointEntity.cs +++ b/src/Artemis.Storage/Entities/KeypointEntity.cs @@ -4,10 +4,10 @@ using System.ComponentModel.DataAnnotations.Schema; namespace Artemis.Storage.Entities { [Table("Keypoints")] - internal class KeypointEntity + public class KeypointEntity { [Key] - public int Id { get; set; } + public string Guid { get; set; } public int Time { get; set; } public string Value { get; set; } diff --git a/src/Artemis.Storage/Entities/LayerEntity.cs b/src/Artemis.Storage/Entities/LayerEntity.cs index d74ae823a..c44d8839e 100644 --- a/src/Artemis.Storage/Entities/LayerEntity.cs +++ b/src/Artemis.Storage/Entities/LayerEntity.cs @@ -5,12 +5,10 @@ using System.ComponentModel.DataAnnotations.Schema; namespace Artemis.Storage.Entities { [Table("Layers")] - internal class LayerEntity + public class LayerEntity { [Key] - public int Id { get; set; } - - public string Type { get; set; } + public string Guid { get; set; } public virtual ICollection Leds { get; set; } public virtual ICollection Settings { get; set; } diff --git a/src/Artemis.Storage/Entities/LayerSettingEntity.cs b/src/Artemis.Storage/Entities/LayerSettingEntity.cs index a9f50cb10..250da711f 100644 --- a/src/Artemis.Storage/Entities/LayerSettingEntity.cs +++ b/src/Artemis.Storage/Entities/LayerSettingEntity.cs @@ -5,10 +5,10 @@ using System.ComponentModel.DataAnnotations.Schema; namespace Artemis.Storage.Entities { [Table("LayerSettings")] - internal class LayerSettingEntity + public class LayerSettingEntity { [Key] - public int Id { get; set; } + public string Guid { get; set; } public string Name { get; set; } public string Value { get; set; } diff --git a/src/Artemis.Storage/Entities/LedEntity.cs b/src/Artemis.Storage/Entities/LedEntity.cs index 22d0a934d..1060c1c0a 100644 --- a/src/Artemis.Storage/Entities/LedEntity.cs +++ b/src/Artemis.Storage/Entities/LedEntity.cs @@ -4,10 +4,10 @@ using System.ComponentModel.DataAnnotations.Schema; namespace Artemis.Storage.Entities { [Table("Leds")] - internal class LedEntity + public class LedEntity { [Key] - public int Id { get; set; } + public string Guid { get; set; } public string LedName { get; set; } public string LimitedToDevice { get; set; } diff --git a/src/Artemis.Storage/Entities/ProfileEntity.cs b/src/Artemis.Storage/Entities/ProfileEntity.cs index 8ae73e9b5..1e39e3b30 100644 --- a/src/Artemis.Storage/Entities/ProfileEntity.cs +++ b/src/Artemis.Storage/Entities/ProfileEntity.cs @@ -1,14 +1,16 @@ -using System.ComponentModel.DataAnnotations; +using System; +using System.ComponentModel.DataAnnotations; namespace Artemis.Storage.Entities { - internal class ProfileEntity + public class ProfileEntity { [Key] - public int Id { get; set; } + public string Guid { get; set; } + + public Guid PluginGuid { get; set; } public string Name { get; set; } - public string Module { get; set; } public int RootFolderId { get; set; } public virtual FolderEntity RootFolder { get; set; } diff --git a/src/Artemis.Storage/Entities/SettingEntity.cs b/src/Artemis.Storage/Entities/SettingEntity.cs index 19690251b..0e4ba5e13 100644 --- a/src/Artemis.Storage/Entities/SettingEntity.cs +++ b/src/Artemis.Storage/Entities/SettingEntity.cs @@ -2,7 +2,7 @@ namespace Artemis.Storage.Entities { - internal class SettingEntity + public class SettingEntity { [Key] public string Name { get; set; } diff --git a/src/Artemis.Storage/Migrations/20180124134310_InitialCreate.cs b/src/Artemis.Storage/Migrations/20180124134310_InitialCreate.cs deleted file mode 100644 index 6d9326b69..000000000 --- a/src/Artemis.Storage/Migrations/20180124134310_InitialCreate.cs +++ /dev/null @@ -1,200 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artemis.Storage.Migrations -{ - public partial class InitialCreate : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - "Folders", - table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - FolderEntityId = table.Column(nullable: true), - Name = table.Column(nullable: true), - Order = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Folders", x => x.Id); - table.ForeignKey( - "FK_Folders_Folders_FolderEntityId", - x => x.FolderEntityId, - "Folders", - "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - "Settings", - table => new - { - Name = table.Column(nullable: false), - Value = table.Column(nullable: true) - }, - constraints: table => { table.PrimaryKey("PK_Settings", x => x.Name); }); - - migrationBuilder.CreateTable( - "Layers", - table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - FolderEntityId = table.Column(nullable: true), - Name = table.Column(nullable: true), - Order = table.Column(nullable: false), - Type = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Layers", x => x.Id); - table.ForeignKey( - "FK_Layers_Folders_FolderEntityId", - x => x.FolderEntityId, - "Folders", - "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - "Profiles", - table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Module = table.Column(nullable: true), - Name = table.Column(nullable: true), - RootFolderId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Profiles", x => x.Id); - table.ForeignKey( - "FK_Profiles_Folders_RootFolderId", - x => x.RootFolderId, - "Folders", - "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - "LayerSettings", - table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - LayerEntityId = table.Column(nullable: true), - Name = table.Column(nullable: true), - Value = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_LayerSettings", x => x.Id); - table.ForeignKey( - "FK_LayerSettings_Layers_LayerEntityId", - x => x.LayerEntityId, - "Layers", - "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - "Leds", - table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - LayerId = table.Column(nullable: false), - LedName = table.Column(nullable: true), - LimitedToDevice = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Leds", x => x.Id); - table.ForeignKey( - "FK_Leds_Layers_LayerId", - x => x.LayerId, - "Layers", - "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - "Keypoints", - table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - LayerSettingEntityId = table.Column(nullable: true), - Time = table.Column(nullable: false), - Value = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Keypoints", x => x.Id); - table.ForeignKey( - "FK_Keypoints_LayerSettings_LayerSettingEntityId", - x => x.LayerSettingEntityId, - "LayerSettings", - "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - "IX_Folders_FolderEntityId", - "Folders", - "FolderEntityId"); - - migrationBuilder.CreateIndex( - "IX_Keypoints_LayerSettingEntityId", - "Keypoints", - "LayerSettingEntityId"); - - migrationBuilder.CreateIndex( - "IX_Layers_FolderEntityId", - "Layers", - "FolderEntityId"); - - migrationBuilder.CreateIndex( - "IX_LayerSettings_LayerEntityId", - "LayerSettings", - "LayerEntityId"); - - migrationBuilder.CreateIndex( - "IX_Leds_LayerId", - "Leds", - "LayerId"); - - migrationBuilder.CreateIndex( - "IX_Profiles_RootFolderId", - "Profiles", - "RootFolderId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - "Keypoints"); - - migrationBuilder.DropTable( - "Leds"); - - migrationBuilder.DropTable( - "Profiles"); - - migrationBuilder.DropTable( - "Settings"); - - migrationBuilder.DropTable( - "LayerSettings"); - - migrationBuilder.DropTable( - "Layers"); - - migrationBuilder.DropTable( - "Folders"); - } - } -} \ No newline at end of file diff --git a/src/Artemis.Storage/Migrations/20180124134310_InitialCreate.Designer.cs b/src/Artemis.Storage/Migrations/20180406175247_InitialCreate.Designer.cs similarity index 70% rename from src/Artemis.Storage/Migrations/20180124134310_InitialCreate.Designer.cs rename to src/Artemis.Storage/Migrations/20180406175247_InitialCreate.Designer.cs index ac48f3eb0..751d62e85 100644 --- a/src/Artemis.Storage/Migrations/20180124134310_InitialCreate.Designer.cs +++ b/src/Artemis.Storage/Migrations/20180406175247_InitialCreate.Designer.cs @@ -5,126 +5,129 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.EntityFrameworkCore.Storage.Internal; using System; namespace Artemis.Storage.Migrations { [DbContext(typeof(StorageContext))] - [Migration("20180124134310_InitialCreate")] + [Migration("20180406175247_InitialCreate")] partial class InitialCreate { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); + .HasAnnotation("ProductVersion", "2.0.2-rtm-10011"); modelBuilder.Entity("Artemis.Storage.Entities.FolderEntity", b => { - b.Property("Id") + b.Property("Guid") .ValueGeneratedOnAdd(); - b.Property("FolderEntityId"); + b.Property("FolderEntityGuid"); b.Property("Name"); b.Property("Order"); - b.HasKey("Id"); + b.HasKey("Guid"); - b.HasIndex("FolderEntityId"); + b.HasIndex("FolderEntityGuid"); b.ToTable("Folders"); }); modelBuilder.Entity("Artemis.Storage.Entities.KeypointEntity", b => { - b.Property("Id") + b.Property("Guid") .ValueGeneratedOnAdd(); - b.Property("LayerSettingEntityId"); + b.Property("LayerSettingEntityGuid"); b.Property("Time"); b.Property("Value"); - b.HasKey("Id"); + b.HasKey("Guid"); - b.HasIndex("LayerSettingEntityId"); + b.HasIndex("LayerSettingEntityGuid"); b.ToTable("Keypoints"); }); modelBuilder.Entity("Artemis.Storage.Entities.LayerEntity", b => { - b.Property("Id") + b.Property("Guid") .ValueGeneratedOnAdd(); - b.Property("FolderEntityId"); + b.Property("FolderEntityGuid"); b.Property("Name"); b.Property("Order"); - b.Property("Type"); + b.HasKey("Guid"); - b.HasKey("Id"); - - b.HasIndex("FolderEntityId"); + b.HasIndex("FolderEntityGuid"); b.ToTable("Layers"); }); modelBuilder.Entity("Artemis.Storage.Entities.LayerSettingEntity", b => { - b.Property("Id") + b.Property("Guid") .ValueGeneratedOnAdd(); - b.Property("LayerEntityId"); + b.Property("LayerEntityGuid"); b.Property("Name"); b.Property("Value"); - b.HasKey("Id"); + b.HasKey("Guid"); - b.HasIndex("LayerEntityId"); + b.HasIndex("LayerEntityGuid"); b.ToTable("LayerSettings"); }); modelBuilder.Entity("Artemis.Storage.Entities.LedEntity", b => { - b.Property("Id") + b.Property("Guid") .ValueGeneratedOnAdd(); + b.Property("LayerGuid"); + b.Property("LayerId"); b.Property("LedName"); b.Property("LimitedToDevice"); - b.HasKey("Id"); + b.HasKey("Guid"); - b.HasIndex("LayerId"); + b.HasIndex("LayerGuid"); b.ToTable("Leds"); }); modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b => { - b.Property("Id") + b.Property("Guid") .ValueGeneratedOnAdd(); - b.Property("Module"); - b.Property("Name"); + b.Property("PluginGuid"); + + b.Property("RootFolderGuid"); + b.Property("RootFolderId"); - b.HasKey("Id"); + b.HasKey("Guid"); - b.HasIndex("RootFolderId"); + b.HasIndex("RootFolderGuid"); b.ToTable("Profiles"); }); @@ -145,44 +148,42 @@ namespace Artemis.Storage.Migrations { b.HasOne("Artemis.Storage.Entities.FolderEntity") .WithMany("Folders") - .HasForeignKey("FolderEntityId"); + .HasForeignKey("FolderEntityGuid"); }); modelBuilder.Entity("Artemis.Storage.Entities.KeypointEntity", b => { b.HasOne("Artemis.Storage.Entities.LayerSettingEntity") .WithMany("Keypoints") - .HasForeignKey("LayerSettingEntityId"); + .HasForeignKey("LayerSettingEntityGuid"); }); modelBuilder.Entity("Artemis.Storage.Entities.LayerEntity", b => { b.HasOne("Artemis.Storage.Entities.FolderEntity") .WithMany("Layers") - .HasForeignKey("FolderEntityId"); + .HasForeignKey("FolderEntityGuid"); }); modelBuilder.Entity("Artemis.Storage.Entities.LayerSettingEntity", b => { b.HasOne("Artemis.Storage.Entities.LayerEntity") .WithMany("Settings") - .HasForeignKey("LayerEntityId"); + .HasForeignKey("LayerEntityGuid"); }); modelBuilder.Entity("Artemis.Storage.Entities.LedEntity", b => { b.HasOne("Artemis.Storage.Entities.LayerEntity", "Layer") .WithMany("Leds") - .HasForeignKey("LayerId") - .OnDelete(DeleteBehavior.Cascade); + .HasForeignKey("LayerGuid"); }); modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b => { b.HasOne("Artemis.Storage.Entities.FolderEntity", "RootFolder") .WithMany() - .HasForeignKey("RootFolderId") - .OnDelete(DeleteBehavior.Cascade); + .HasForeignKey("RootFolderGuid"); }); #pragma warning restore 612, 618 } diff --git a/src/Artemis.Storage/Migrations/20180406175247_InitialCreate.cs b/src/Artemis.Storage/Migrations/20180406175247_InitialCreate.cs new file mode 100644 index 000000000..8ff05fdf3 --- /dev/null +++ b/src/Artemis.Storage/Migrations/20180406175247_InitialCreate.cs @@ -0,0 +1,200 @@ +using Microsoft.EntityFrameworkCore.Migrations; +using System; +using System.Collections.Generic; + +namespace Artemis.Storage.Migrations +{ + public partial class InitialCreate : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Folders", + columns: table => new + { + Guid = table.Column(nullable: false), + FolderEntityGuid = table.Column(nullable: true), + Name = table.Column(nullable: true), + Order = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Folders", x => x.Guid); + table.ForeignKey( + name: "FK_Folders_Folders_FolderEntityGuid", + column: x => x.FolderEntityGuid, + principalTable: "Folders", + principalColumn: "Guid", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Settings", + columns: table => new + { + Name = table.Column(nullable: false), + Value = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Settings", x => x.Name); + }); + + migrationBuilder.CreateTable( + name: "Layers", + columns: table => new + { + Guid = table.Column(nullable: false), + FolderEntityGuid = table.Column(nullable: true), + Name = table.Column(nullable: true), + Order = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Layers", x => x.Guid); + table.ForeignKey( + name: "FK_Layers_Folders_FolderEntityGuid", + column: x => x.FolderEntityGuid, + principalTable: "Folders", + principalColumn: "Guid", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Profiles", + columns: table => new + { + Guid = table.Column(nullable: false), + Name = table.Column(nullable: true), + PluginGuid = table.Column(nullable: false), + RootFolderGuid = table.Column(nullable: true), + RootFolderId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Profiles", x => x.Guid); + table.ForeignKey( + name: "FK_Profiles_Folders_RootFolderGuid", + column: x => x.RootFolderGuid, + principalTable: "Folders", + principalColumn: "Guid", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "LayerSettings", + columns: table => new + { + Guid = table.Column(nullable: false), + LayerEntityGuid = table.Column(nullable: true), + Name = table.Column(nullable: true), + Value = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_LayerSettings", x => x.Guid); + table.ForeignKey( + name: "FK_LayerSettings_Layers_LayerEntityGuid", + column: x => x.LayerEntityGuid, + principalTable: "Layers", + principalColumn: "Guid", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Leds", + columns: table => new + { + Guid = table.Column(nullable: false), + LayerGuid = table.Column(nullable: true), + LayerId = table.Column(nullable: false), + LedName = table.Column(nullable: true), + LimitedToDevice = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Leds", x => x.Guid); + table.ForeignKey( + name: "FK_Leds_Layers_LayerGuid", + column: x => x.LayerGuid, + principalTable: "Layers", + principalColumn: "Guid", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Keypoints", + columns: table => new + { + Guid = table.Column(nullable: false), + LayerSettingEntityGuid = table.Column(nullable: true), + Time = table.Column(nullable: false), + Value = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Keypoints", x => x.Guid); + table.ForeignKey( + name: "FK_Keypoints_LayerSettings_LayerSettingEntityGuid", + column: x => x.LayerSettingEntityGuid, + principalTable: "LayerSettings", + principalColumn: "Guid", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_Folders_FolderEntityGuid", + table: "Folders", + column: "FolderEntityGuid"); + + migrationBuilder.CreateIndex( + name: "IX_Keypoints_LayerSettingEntityGuid", + table: "Keypoints", + column: "LayerSettingEntityGuid"); + + migrationBuilder.CreateIndex( + name: "IX_Layers_FolderEntityGuid", + table: "Layers", + column: "FolderEntityGuid"); + + migrationBuilder.CreateIndex( + name: "IX_LayerSettings_LayerEntityGuid", + table: "LayerSettings", + column: "LayerEntityGuid"); + + migrationBuilder.CreateIndex( + name: "IX_Leds_LayerGuid", + table: "Leds", + column: "LayerGuid"); + + migrationBuilder.CreateIndex( + name: "IX_Profiles_RootFolderGuid", + table: "Profiles", + column: "RootFolderGuid"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Keypoints"); + + migrationBuilder.DropTable( + name: "Leds"); + + migrationBuilder.DropTable( + name: "Profiles"); + + migrationBuilder.DropTable( + name: "Settings"); + + migrationBuilder.DropTable( + name: "LayerSettings"); + + migrationBuilder.DropTable( + name: "Layers"); + + migrationBuilder.DropTable( + name: "Folders"); + } + } +} diff --git a/src/Artemis.Storage/Migrations/StorageContextModelSnapshot.cs b/src/Artemis.Storage/Migrations/StorageContextModelSnapshot.cs index 1cef1a47c..73a5fc452 100644 --- a/src/Artemis.Storage/Migrations/StorageContextModelSnapshot.cs +++ b/src/Artemis.Storage/Migrations/StorageContextModelSnapshot.cs @@ -1,185 +1,190 @@ // - +using Artemis.Storage; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.EntityFrameworkCore.Storage.Internal; +using System; namespace Artemis.Storage.Migrations { [DbContext(typeof(StorageContext))] - internal class StorageContextModelSnapshot : ModelSnapshot + partial class StorageContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); + .HasAnnotation("ProductVersion", "2.0.2-rtm-10011"); modelBuilder.Entity("Artemis.Storage.Entities.FolderEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Guid") + .ValueGeneratedOnAdd(); - b.Property("FolderEntityId"); + b.Property("FolderEntityGuid"); - b.Property("Name"); + b.Property("Name"); - b.Property("Order"); + b.Property("Order"); - b.HasKey("Id"); + b.HasKey("Guid"); - b.HasIndex("FolderEntityId"); + b.HasIndex("FolderEntityGuid"); - b.ToTable("Folders"); - }); + b.ToTable("Folders"); + }); modelBuilder.Entity("Artemis.Storage.Entities.KeypointEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Guid") + .ValueGeneratedOnAdd(); - b.Property("LayerSettingEntityId"); + b.Property("LayerSettingEntityGuid"); - b.Property("Time"); + b.Property("Time"); - b.Property("Value"); + b.Property("Value"); - b.HasKey("Id"); + b.HasKey("Guid"); - b.HasIndex("LayerSettingEntityId"); + b.HasIndex("LayerSettingEntityGuid"); - b.ToTable("Keypoints"); - }); + b.ToTable("Keypoints"); + }); modelBuilder.Entity("Artemis.Storage.Entities.LayerEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Guid") + .ValueGeneratedOnAdd(); - b.Property("FolderEntityId"); + b.Property("FolderEntityGuid"); - b.Property("Name"); + b.Property("Name"); - b.Property("Order"); + b.Property("Order"); - b.Property("Type"); + b.HasKey("Guid"); - b.HasKey("Id"); + b.HasIndex("FolderEntityGuid"); - b.HasIndex("FolderEntityId"); - - b.ToTable("Layers"); - }); + b.ToTable("Layers"); + }); modelBuilder.Entity("Artemis.Storage.Entities.LayerSettingEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Guid") + .ValueGeneratedOnAdd(); - b.Property("LayerEntityId"); + b.Property("LayerEntityGuid"); - b.Property("Name"); + b.Property("Name"); - b.Property("Value"); + b.Property("Value"); - b.HasKey("Id"); + b.HasKey("Guid"); - b.HasIndex("LayerEntityId"); + b.HasIndex("LayerEntityGuid"); - b.ToTable("LayerSettings"); - }); + b.ToTable("LayerSettings"); + }); modelBuilder.Entity("Artemis.Storage.Entities.LedEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Guid") + .ValueGeneratedOnAdd(); - b.Property("LayerId"); + b.Property("LayerGuid"); - b.Property("LedName"); + b.Property("LayerId"); - b.Property("LimitedToDevice"); + b.Property("LedName"); - b.HasKey("Id"); + b.Property("LimitedToDevice"); - b.HasIndex("LayerId"); + b.HasKey("Guid"); - b.ToTable("Leds"); - }); + b.HasIndex("LayerGuid"); + + b.ToTable("Leds"); + }); modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Guid") + .ValueGeneratedOnAdd(); - b.Property("Module"); + b.Property("Name"); - b.Property("Name"); + b.Property("PluginGuid"); - b.Property("RootFolderId"); + b.Property("RootFolderGuid"); - b.HasKey("Id"); + b.Property("RootFolderId"); - b.HasIndex("RootFolderId"); + b.HasKey("Guid"); - b.ToTable("Profiles"); - }); + b.HasIndex("RootFolderGuid"); + + b.ToTable("Profiles"); + }); modelBuilder.Entity("Artemis.Storage.Entities.SettingEntity", b => - { - b.Property("Name") - .ValueGeneratedOnAdd(); + { + b.Property("Name") + .ValueGeneratedOnAdd(); - b.Property("Value"); + b.Property("Value"); - b.HasKey("Name"); + b.HasKey("Name"); - b.ToTable("Settings"); - }); + b.ToTable("Settings"); + }); modelBuilder.Entity("Artemis.Storage.Entities.FolderEntity", b => - { - b.HasOne("Artemis.Storage.Entities.FolderEntity") - .WithMany("Folders") - .HasForeignKey("FolderEntityId"); - }); + { + b.HasOne("Artemis.Storage.Entities.FolderEntity") + .WithMany("Folders") + .HasForeignKey("FolderEntityGuid"); + }); modelBuilder.Entity("Artemis.Storage.Entities.KeypointEntity", b => - { - b.HasOne("Artemis.Storage.Entities.LayerSettingEntity") - .WithMany("Keypoints") - .HasForeignKey("LayerSettingEntityId"); - }); + { + b.HasOne("Artemis.Storage.Entities.LayerSettingEntity") + .WithMany("Keypoints") + .HasForeignKey("LayerSettingEntityGuid"); + }); modelBuilder.Entity("Artemis.Storage.Entities.LayerEntity", b => - { - b.HasOne("Artemis.Storage.Entities.FolderEntity") - .WithMany("Layers") - .HasForeignKey("FolderEntityId"); - }); + { + b.HasOne("Artemis.Storage.Entities.FolderEntity") + .WithMany("Layers") + .HasForeignKey("FolderEntityGuid"); + }); modelBuilder.Entity("Artemis.Storage.Entities.LayerSettingEntity", b => - { - b.HasOne("Artemis.Storage.Entities.LayerEntity") - .WithMany("Settings") - .HasForeignKey("LayerEntityId"); - }); + { + b.HasOne("Artemis.Storage.Entities.LayerEntity") + .WithMany("Settings") + .HasForeignKey("LayerEntityGuid"); + }); modelBuilder.Entity("Artemis.Storage.Entities.LedEntity", b => - { - b.HasOne("Artemis.Storage.Entities.LayerEntity", "Layer") - .WithMany("Leds") - .HasForeignKey("LayerId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("Artemis.Storage.Entities.LayerEntity", "Layer") + .WithMany("Leds") + .HasForeignKey("LayerGuid"); + }); modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b => - { - b.HasOne("Artemis.Storage.Entities.FolderEntity", "RootFolder") - .WithMany() - .HasForeignKey("RootFolderId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("Artemis.Storage.Entities.FolderEntity", "RootFolder") + .WithMany() + .HasForeignKey("RootFolderGuid"); + }); #pragma warning restore 612, 618 } } -} \ No newline at end of file +} diff --git a/src/Artemis.Storage/StorageContext.cs b/src/Artemis.Storage/StorageContext.cs index e9cdb027d..b10e0a006 100644 --- a/src/Artemis.Storage/StorageContext.cs +++ b/src/Artemis.Storage/StorageContext.cs @@ -3,10 +3,10 @@ using Microsoft.EntityFrameworkCore; namespace Artemis.Storage { - internal class StorageContext : DbContext + public class StorageContext : DbContext { - internal DbSet Profiles { get; set; } - internal DbSet Settings { get; set; } + public DbSet Profiles { get; set; } + public DbSet Settings { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { diff --git a/src/Artemis.UI/App.config b/src/Artemis.UI/App.config index dfd6fa450..7d73a5c5e 100644 --- a/src/Artemis.UI/App.config +++ b/src/Artemis.UI/App.config @@ -16,7 +16,7 @@ - + @@ -31,8 +31,7 @@ - + @@ -56,8 +55,7 @@ - + @@ -72,6 +70,14 @@ + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj index bf7cb5a3f..8c39bb877 100644 --- a/src/Artemis.UI/Artemis.UI.csproj +++ b/src/Artemis.UI/Artemis.UI.csproj @@ -70,46 +70,46 @@ ..\packages\PropertyChanged.Fody.2.2.6\lib\net452\PropertyChanged.dll - ..\packages\RGB.NET.Brushes.0.0.1.38\lib\net45\RGB.NET.Brushes.dll + ..\packages\RGB.NET.Brushes.0.0.1.48\lib\net45\RGB.NET.Brushes.dll - ..\packages\RGB.NET.Core.0.0.1.38\lib\net45\RGB.NET.Core.dll + ..\packages\RGB.NET.Core.0.0.1.48\lib\net45\RGB.NET.Core.dll - ..\packages\RGB.NET.Decorators.0.0.1.38\lib\net45\RGB.NET.Decorators.dll + ..\packages\RGB.NET.Decorators.0.0.1.48\lib\net45\RGB.NET.Decorators.dll - ..\packages\RGB.NET.Devices.Asus.0.0.1.38\lib\net45\RGB.NET.Devices.Asus.dll + ..\packages\RGB.NET.Devices.Asus.0.0.1.48\lib\net45\RGB.NET.Devices.Asus.dll - ..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.38\lib\net45\RGB.NET.Devices.CoolerMaster.dll + ..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.48\lib\net45\RGB.NET.Devices.CoolerMaster.dll - ..\packages\RGB.NET.Devices.Corsair.0.0.1.38\lib\net45\RGB.NET.Devices.Corsair.dll + ..\packages\RGB.NET.Devices.Corsair.0.0.1.48\lib\net45\RGB.NET.Devices.Corsair.dll - ..\packages\RGB.NET.Devices.DMX.0.0.1.38\lib\net45\RGB.NET.Devices.DMX.dll + ..\packages\RGB.NET.Devices.DMX.0.0.1.48\lib\net45\RGB.NET.Devices.DMX.dll - ..\packages\RGB.NET.Devices.Logitech.0.0.1.38\lib\net45\RGB.NET.Devices.Logitech.dll + ..\packages\RGB.NET.Devices.Logitech.0.0.1.48\lib\net45\RGB.NET.Devices.Logitech.dll ..\packages\RGB.NET.Devices.Msi.0.0.1.38\lib\net45\RGB.NET.Devices.Msi.dll - ..\packages\RGB.NET.Devices.Novation.0.0.1.38\lib\net45\RGB.NET.Devices.Novation.dll + ..\packages\RGB.NET.Devices.Novation.0.0.1.48\lib\net45\RGB.NET.Devices.Novation.dll - ..\packages\RGB.NET.Devices.Razer.0.0.1.38\lib\net45\RGB.NET.Devices.Razer.dll + ..\packages\RGB.NET.Devices.Razer.0.0.1.48\lib\net45\RGB.NET.Devices.Razer.dll - ..\packages\RGB.NET.Groups.0.0.1.38\lib\net45\RGB.NET.Groups.dll + ..\packages\RGB.NET.Groups.0.0.1.48\lib\net45\RGB.NET.Groups.dll ..\packages\RGB.NET.Input.0.0.1.38\lib\net45\RGB.NET.Input.dll - ..\packages\RGB.NET.Input.Corsair.0.0.1.38\lib\net45\RGB.NET.Input.Corsair.dll + ..\packages\RGB.NET.Input.Corsair.0.0.1.42\lib\net45\RGB.NET.Input.Corsair.dll ..\packages\Sanford.Multimedia.Midi.6.6.0\lib\net20\Sanford.Multimedia.Midi.dll @@ -228,10 +228,6 @@ {106f08ae-5fe8-433e-aa65-64e5219b5fc7} Artemis.Plugins.BuiltIn - - {cd23bc5e-57f0-46ce-a007-24d031146219} - Artemis.Plugins - {e489e5e3-1a65-4af5-a1ea-f9805fd19a65} Artemis.Storage @@ -251,27 +247,17 @@ + + echo Copying built-in plugins... +xcopy /s /y /q $(SolutionDir)Artemis.Plugins.BuiltIn\Modules %25ProgramData%25\Artemis\plugins + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - - echo Copying built-in plugins... -xcopy /s /y /q $(SolutionDir)Artemis.Plugins.BuiltIn\Modules %25ProgramData%25\Artemis\plugins - \ No newline at end of file diff --git a/src/Artemis.UI/Stylet/ArtemisViewManager.cs b/src/Artemis.UI/Stylet/ArtemisViewManager.cs index 176231bcb..55beb3441 100644 --- a/src/Artemis.UI/Stylet/ArtemisViewManager.cs +++ b/src/Artemis.UI/Stylet/ArtemisViewManager.cs @@ -1,7 +1,7 @@ using System.IO; using System.Windows; using System.Windows.Markup; -using Artemis.Plugins.Interfaces; +using Artemis.Core.Plugins.Interfaces; using Stylet; namespace Artemis.UI.Stylet diff --git a/src/Artemis.UI/ViewModels/RootViewModel.cs b/src/Artemis.UI/ViewModels/RootViewModel.cs index 5361a49d7..65937ba15 100644 --- a/src/Artemis.UI/ViewModels/RootViewModel.cs +++ b/src/Artemis.UI/ViewModels/RootViewModel.cs @@ -4,9 +4,9 @@ using System.ComponentModel; using System.Linq; using System.Threading.Tasks; using System.Windows.Controls; +using Artemis.Core.Plugins.Interfaces; +using Artemis.Core.Plugins.Models; using Artemis.Core.Services.Interfaces; -using Artemis.Plugins.Interfaces; -using Artemis.Plugins.Models; using Artemis.UI.ViewModels.Interfaces; using Stylet; diff --git a/src/Artemis.UI/Views/RootView.xaml b/src/Artemis.UI/Views/RootView.xaml index 00b02cc8c..1fc60f6eb 100644 --- a/src/Artemis.UI/Views/RootView.xaml +++ b/src/Artemis.UI/Views/RootView.xaml @@ -7,7 +7,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:s="https://github.com/canton7/Stylet" xmlns:vms="clr-namespace:Artemis.UI.ViewModels" - xmlns:models="clr-namespace:Artemis.Plugins.Models;assembly=Artemis.Plugins" + xmlns:models="clr-namespace:Artemis.Core.Plugins.Models;assembly=Artemis.Core" mc:Ignorable="d" GlowBrush="{DynamicResource AccentColorBrush}" FontFamily="{StaticResource DefaultFont}" diff --git a/src/Artemis.UI/packages.config b/src/Artemis.UI/packages.config index 76ba242d7..fbac0ff0e 100644 --- a/src/Artemis.UI/packages.config +++ b/src/Artemis.UI/packages.config @@ -1,5 +1,4 @@  - @@ -14,21 +13,21 @@ - - - + + + - - - - - + + + + + - - - + + + - + diff --git a/src/Artemis.sln b/src/Artemis.sln index 900f8f78a..73aaa67e8 100644 --- a/src/Artemis.sln +++ b/src/Artemis.sln @@ -9,8 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Artemis.Storage", "Artemis. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.Core", "Artemis.Core\Artemis.Core.csproj", "{9B811F9B-86B9-4771-87AF-72BAE7078A36}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.Plugins", "Artemis.Plugins\Artemis.Plugins.csproj", "{CD23BC5E-57F0-46CE-A007-24D031146219}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.Plugins.BuiltIn", "Artemis.Plugins.BuiltIn\Artemis.Plugins.BuiltIn.csproj", "{106F08AE-5FE8-433E-AA65-64E5219B5FC7}" EndProject Global @@ -31,10 +29,6 @@ Global {9B811F9B-86B9-4771-87AF-72BAE7078A36}.Debug|Any CPU.Build.0 = Debug|Any CPU {9B811F9B-86B9-4771-87AF-72BAE7078A36}.Release|Any CPU.ActiveCfg = Release|Any CPU {9B811F9B-86B9-4771-87AF-72BAE7078A36}.Release|Any CPU.Build.0 = Release|Any CPU - {CD23BC5E-57F0-46CE-A007-24D031146219}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CD23BC5E-57F0-46CE-A007-24D031146219}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD23BC5E-57F0-46CE-A007-24D031146219}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CD23BC5E-57F0-46CE-A007-24D031146219}.Release|Any CPU.Build.0 = Release|Any CPU {106F08AE-5FE8-433E-AA65-64E5219B5FC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {106F08AE-5FE8-433E-AA65-64E5219B5FC7}.Debug|Any CPU.Build.0 = Debug|Any CPU {106F08AE-5FE8-433E-AA65-64E5219B5FC7}.Release|Any CPU.ActiveCfg = Release|Any CPU