diff --git a/src/Artemis.Core/Artemis.Core.csproj b/src/Artemis.Core/Artemis.Core.csproj index 814ddc2dd..957a4b1ef 100644 --- a/src/Artemis.Core/Artemis.Core.csproj +++ b/src/Artemis.Core/Artemis.Core.csproj @@ -32,43 +32,62 @@ 4 + + ..\packages\Castle.Core.4.2.0\lib\net45\Castle.Core.dll + + + ..\packages\HidSharp.1.5\lib\net35\HidSharp.dll + + + ..\packages\Ninject.3.3.4\lib\net45\Ninject.dll + + + ..\packages\Ninject.Extensions.Conventions.3.3.0\lib\net45\Ninject.Extensions.Conventions.dll + + + ..\packages\Ninject.Extensions.Factory.3.3.2\lib\net45\Ninject.Extensions.Factory.dll + - ..\packages\RGB.NET.Brushes.0.0.1.10\lib\net45\RGB.NET.Brushes.dll + ..\packages\RGB.NET.Brushes.0.0.1.18\lib\net45\RGB.NET.Brushes.dll - ..\packages\RGB.NET.Core.0.0.1.10\lib\net45\RGB.NET.Core.dll + ..\packages\RGB.NET.Core.0.0.1.18\lib\net45\RGB.NET.Core.dll - ..\packages\RGB.NET.Decorators.0.0.1.10\lib\net45\RGB.NET.Decorators.dll + ..\packages\RGB.NET.Decorators.0.0.1.18\lib\net45\RGB.NET.Decorators.dll - ..\packages\RGB.NET.Devices.Asus.0.0.1.10\lib\net45\RGB.NET.Devices.Asus.dll + ..\packages\RGB.NET.Devices.Asus.0.0.1.18\lib\net45\RGB.NET.Devices.Asus.dll - ..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.10\lib\net45\RGB.NET.Devices.CoolerMaster.dll + ..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.18\lib\net45\RGB.NET.Devices.CoolerMaster.dll - ..\packages\RGB.NET.Devices.Corsair.0.0.1.10\lib\net45\RGB.NET.Devices.Corsair.dll + ..\packages\RGB.NET.Devices.Corsair.0.0.1.18\lib\net45\RGB.NET.Devices.Corsair.dll - ..\packages\RGB.NET.Devices.Logitech.0.0.1.10\lib\net45\RGB.NET.Devices.Logitech.dll + ..\packages\RGB.NET.Devices.Logitech.0.0.1.18\lib\net45\RGB.NET.Devices.Logitech.dll - ..\packages\RGB.NET.Devices.Msi.0.0.1.10\lib\net45\RGB.NET.Devices.Msi.dll + ..\packages\RGB.NET.Devices.Msi.0.0.1.18\lib\net45\RGB.NET.Devices.Msi.dll - ..\packages\RGB.NET.Devices.Novation.0.0.1.10\lib\net45\RGB.NET.Devices.Novation.dll + ..\packages\RGB.NET.Devices.Novation.0.0.1.18\lib\net45\RGB.NET.Devices.Novation.dll + + + ..\packages\RGB.NET.Devices.Razer.0.0.1.18\lib\net45\RGB.NET.Devices.Razer.dll - ..\packages\RGB.NET.Groups.0.0.1.10\lib\net45\RGB.NET.Groups.dll + ..\packages\RGB.NET.Groups.0.0.1.18\lib\net45\RGB.NET.Groups.dll ..\packages\Sanford.Multimedia.Midi.6.4.1\lib\net20\Sanford.Multimedia.Midi.dll + - - ..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + + ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll @@ -78,25 +97,34 @@ + + + + + + + - + 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/Ninject/CoreModule.cs b/src/Artemis.Core/Ninject/CoreModule.cs new file mode 100644 index 000000000..6b1c062c2 --- /dev/null +++ b/src/Artemis.Core/Ninject/CoreModule.cs @@ -0,0 +1,22 @@ +using Artemis.Core.Services.Interfaces; +using Ninject.Extensions.Conventions; +using Ninject.Modules; + +namespace Artemis.Core.Ninject +{ + public class CoreModule : NinjectModule + { + public override void Load() + { + // Bind all services as singletons + Kernel.Bind(x => + { + x.FromThisAssembly() + .SelectAllClasses() + .InheritedFrom() + .BindAllInterfaces() + .Configure(c => c.InSingletonScope()); + }); + } + } +} \ No newline at end of file diff --git a/src/Artemis.Core/Properties/AssemblyInfo.cs b/src/Artemis.Core/Properties/AssemblyInfo.cs index bdb7eb11d..5b9b61ea8 100644 --- a/src/Artemis.Core/Properties/AssemblyInfo.cs +++ b/src/Artemis.Core/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following @@ -33,4 +32,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/src/Artemis.Core/Services/CoreService.cs b/src/Artemis.Core/Services/CoreService.cs new file mode 100644 index 000000000..eb57be6da --- /dev/null +++ b/src/Artemis.Core/Services/CoreService.cs @@ -0,0 +1,8 @@ +using Artemis.Core.Services.Interfaces; + +namespace Artemis.Core.Services +{ + public class CoreService : ICoreService + { + } +} \ No newline at end of file diff --git a/src/Artemis.Core/Services/Interfaces/IArtemisService.cs b/src/Artemis.Core/Services/Interfaces/IArtemisService.cs new file mode 100644 index 000000000..2340610a1 --- /dev/null +++ b/src/Artemis.Core/Services/Interfaces/IArtemisService.cs @@ -0,0 +1,6 @@ +namespace Artemis.Core.Services.Interfaces +{ + public interface IArtemisService + { + } +} \ No newline at end of file diff --git a/src/Artemis.Core/Services/Interfaces/ICoreService.cs b/src/Artemis.Core/Services/Interfaces/ICoreService.cs new file mode 100644 index 000000000..ed05a41fe --- /dev/null +++ b/src/Artemis.Core/Services/Interfaces/ICoreService.cs @@ -0,0 +1,6 @@ +namespace Artemis.Core.Services.Interfaces +{ + public interface ICoreService + { + } +} \ No newline at end of file diff --git a/src/Artemis.Core/Services/Interfaces/IModuleService.cs b/src/Artemis.Core/Services/Interfaces/IModuleService.cs new file mode 100644 index 000000000..279f1950e --- /dev/null +++ b/src/Artemis.Core/Services/Interfaces/IModuleService.cs @@ -0,0 +1,6 @@ +namespace Artemis.Core.Services.Interfaces +{ + public interface IModuleService + { + } +} \ No newline at end of file diff --git a/src/Artemis.Core/Services/ModuleService.cs b/src/Artemis.Core/Services/ModuleService.cs new file mode 100644 index 000000000..5933c24cd --- /dev/null +++ b/src/Artemis.Core/Services/ModuleService.cs @@ -0,0 +1,8 @@ +using Artemis.Core.Services.Interfaces; + +namespace Artemis.Core.Services +{ + public class ModuleService : IModuleService + { + } +} \ No newline at end of file diff --git a/src/Artemis.Core/app.config b/src/Artemis.Core/app.config new file mode 100644 index 000000000..a457a7c8d --- /dev/null +++ b/src/Artemis.Core/app.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.Core/packages.config b/src/Artemis.Core/packages.config index cf5495b0c..49638bdc5 100644 --- a/src/Artemis.Core/packages.config +++ b/src/Artemis.Core/packages.config @@ -1,18 +1,25 @@  + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/src/Artemis.Storage/Entities/Layer.cs b/src/Artemis.Storage/Entities/Layer.cs index f29e308db..449461a71 100644 --- a/src/Artemis.Storage/Entities/Layer.cs +++ b/src/Artemis.Storage/Entities/Layer.cs @@ -15,4 +15,4 @@ namespace Artemis.Storage.Entities internal enum LayerType { } -} +} \ No newline at end of file diff --git a/src/Artemis.Storage/Entities/Profile.cs b/src/Artemis.Storage/Entities/Profile.cs index f0f2cda90..b9bdf8252 100644 --- a/src/Artemis.Storage/Entities/Profile.cs +++ b/src/Artemis.Storage/Entities/Profile.cs @@ -7,7 +7,8 @@ namespace Artemis.Storage.Entities { [Key] public int Id { get; set; } + public string Name { get; set; } public virtual ICollection Layers { get; set; } } -} +} \ No newline at end of file diff --git a/src/Artemis.Storage/Entities/Setting.cs b/src/Artemis.Storage/Entities/Setting.cs index bb1fe6c92..4463e1971 100644 --- a/src/Artemis.Storage/Entities/Setting.cs +++ b/src/Artemis.Storage/Entities/Setting.cs @@ -6,6 +6,7 @@ namespace Artemis.Storage.Entities { [Key] public string Name { get; set; } + public string Value { get; set; } } -} +} \ No newline at end of file diff --git a/src/Artemis.Storage/Migrations/20171208203331_InitialCreate.cs b/src/Artemis.Storage/Migrations/20171208203331_InitialCreate.cs index 70ab38b44..84894e771 100644 --- a/src/Artemis.Storage/Migrations/20171208203331_InitialCreate.cs +++ b/src/Artemis.Storage/Migrations/20171208203331_InitialCreate.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace Artemis.Storage.Migrations { @@ -9,45 +7,39 @@ namespace Artemis.Storage.Migrations protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( - name: "Profiles", - columns: table => new + "Profiles", + table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), Name = table.Column(nullable: true) }, - constraints: table => - { - table.PrimaryKey("PK_Profiles", x => x.Id); - }); + constraints: table => { table.PrimaryKey("PK_Profiles", x => x.Id); }); migrationBuilder.CreateTable( - name: "Settings", - columns: table => new + "Settings", + table => new { Name = table.Column(nullable: false), Value = table.Column(nullable: true) }, - constraints: table => - { - table.PrimaryKey("PK_Settings", x => x.Name); - }); + constraints: table => { table.PrimaryKey("PK_Settings", x => x.Name); }); migrationBuilder.CreateTable( - name: "Layer", - columns: table => new + "Layer", + table => new { ProfileId = table.Column(nullable: false), Name = table.Column(nullable: false) }, constraints: table => { - table.PrimaryKey("PK_Layer", x => new { x.ProfileId, x.Name }); + table.PrimaryKey("PK_Layer", x => new {x.ProfileId, x.Name}); table.ForeignKey( - name: "FK_Layer_Profiles_ProfileId", - column: x => x.ProfileId, - principalTable: "Profiles", - principalColumn: "Id", + "FK_Layer_Profiles_ProfileId", + x => x.ProfileId, + "Profiles", + "Id", onDelete: ReferentialAction.Cascade); }); } @@ -55,13 +47,13 @@ namespace Artemis.Storage.Migrations protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( - name: "Layer"); + "Layer"); migrationBuilder.DropTable( - name: "Settings"); + "Settings"); migrationBuilder.DropTable( - name: "Profiles"); + "Profiles"); } } -} +} \ No newline at end of file diff --git a/src/Artemis.Storage/Migrations/StorageContextModelSnapshot.cs b/src/Artemis.Storage/Migrations/StorageContextModelSnapshot.cs index 80d83b4db..3cd74ed41 100644 --- a/src/Artemis.Storage/Migrations/StorageContextModelSnapshot.cs +++ b/src/Artemis.Storage/Migrations/StorageContextModelSnapshot.cs @@ -1,16 +1,12 @@ // -using Artemis.Storage; + using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using System; namespace Artemis.Storage.Migrations { [DbContext(typeof(StorageContext))] - partial class StorageContextModelSnapshot : ModelSnapshot + internal class StorageContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { @@ -19,48 +15,48 @@ namespace Artemis.Storage.Migrations .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); modelBuilder.Entity("Artemis.Storage.Entities.Layer", b => - { - b.Property("ProfileId"); + { + b.Property("ProfileId"); - b.Property("Name"); + b.Property("Name"); - b.HasKey("ProfileId", "Name"); + b.HasKey("ProfileId", "Name"); - b.ToTable("Layer"); - }); + b.ToTable("Layer"); + }); modelBuilder.Entity("Artemis.Storage.Entities.Profile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Id") + .ValueGeneratedOnAdd(); - b.Property("Name"); + b.Property("Name"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("Profiles"); - }); + b.ToTable("Profiles"); + }); modelBuilder.Entity("Artemis.Storage.Entities.Setting", 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.Layer", b => - { - b.HasOne("Artemis.Storage.Entities.Profile", "Profile") - .WithMany("Layers") - .HasForeignKey("ProfileId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("Artemis.Storage.Entities.Profile", "Profile") + .WithMany("Layers") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade); + }); #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 b9a356e45..791e0818e 100644 --- a/src/Artemis.Storage/StorageContext.cs +++ b/src/Artemis.Storage/StorageContext.cs @@ -25,4 +25,4 @@ namespace Artemis.Storage #endregion } -} +} \ No newline at end of file diff --git a/src/Artemis.UI/App.config b/src/Artemis.UI/App.config index cef76b5d2..9045fef60 100644 --- a/src/Artemis.UI/App.config +++ b/src/Artemis.UI/App.config @@ -1,8 +1,9 @@  + - - - + + + diff --git a/src/Artemis.UI/App.xaml b/src/Artemis.UI/App.xaml index ae032a192..e35fc8d83 100644 --- a/src/Artemis.UI/App.xaml +++ b/src/Artemis.UI/App.xaml @@ -17,44 +17,54 @@ - + - - - - + + + + - - + + - + - - - - - - + + + + + + - - + + - - - - - - - - + + + + + + + + - - + + \ No newline at end of file diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj index f8a73ff1e..02b510d1f 100644 --- a/src/Artemis.UI/Artemis.UI.csproj +++ b/src/Artemis.UI/Artemis.UI.csproj @@ -94,13 +94,16 @@ + + App.xaml Code + Designer MSBuild:Compile @@ -109,6 +112,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + diff --git a/src/Artemis.UI/Ninject/UiModule.cs b/src/Artemis.UI/Ninject/UiModule.cs index 5b33287d3..a04c20fe3 100644 --- a/src/Artemis.UI/Ninject/UiModule.cs +++ b/src/Artemis.UI/Ninject/UiModule.cs @@ -4,14 +4,18 @@ using Ninject.Modules; namespace Artemis.UI.Ninject { + // ReSharper disable once InconsistentNaming public class UIModule : NinjectModule { public override void Load() { - // Bind all viewmodels + // Bind all built-in viewmodels Kernel.Bind(x => { - x.FromThisAssembly().SelectAllClasses().InheritedFrom().BindAllInterfaces(); + x.FromThisAssembly() + .SelectAllClasses() + .InheritedFrom() + .BindAllInterfaces(); }); } } diff --git a/src/Artemis.UI/ViewModels/HomeViewModel.cs b/src/Artemis.UI/ViewModels/HomeViewModel.cs index b671bd422..25d99189d 100644 --- a/src/Artemis.UI/ViewModels/HomeViewModel.cs +++ b/src/Artemis.UI/ViewModels/HomeViewModel.cs @@ -5,7 +5,7 @@ using Stylet; namespace Artemis.UI.ViewModels { - public class HomeViewModel : Screen, IMainViewModel + public class HomeViewModel : Screen, IHomeViewModel { public string Title => "Home"; @@ -16,8 +16,4 @@ namespace Artemis.UI.ViewModels Process.Start(url); } } - - public interface IMainViewModel : IArtemisViewModel - { - } } \ No newline at end of file diff --git a/src/Artemis.UI/ViewModels/Interfaces/IHomeViewModel.cs b/src/Artemis.UI/ViewModels/Interfaces/IHomeViewModel.cs new file mode 100644 index 000000000..a16a74f84 --- /dev/null +++ b/src/Artemis.UI/ViewModels/Interfaces/IHomeViewModel.cs @@ -0,0 +1,7 @@ +namespace Artemis.UI.ViewModels.Interfaces +{ + public interface IHomeViewModel : IArtemisViewModel + { + void OpenUrl(string url); + } +} \ No newline at end of file diff --git a/src/Artemis.UI/ViewModels/Interfaces/ISettingsViewModel.cs b/src/Artemis.UI/ViewModels/Interfaces/ISettingsViewModel.cs new file mode 100644 index 000000000..34bf2f59c --- /dev/null +++ b/src/Artemis.UI/ViewModels/Interfaces/ISettingsViewModel.cs @@ -0,0 +1,6 @@ +namespace Artemis.UI.ViewModels.Interfaces +{ + public interface ISettingsViewModel : IArtemisViewModel + { + } +} \ No newline at end of file diff --git a/src/Artemis.UI/ViewModels/RootViewModel.cs b/src/Artemis.UI/ViewModels/RootViewModel.cs index ae1022526..f77b30f2b 100644 --- a/src/Artemis.UI/ViewModels/RootViewModel.cs +++ b/src/Artemis.UI/ViewModels/RootViewModel.cs @@ -7,12 +7,37 @@ namespace Artemis.UI.ViewModels { public class RootViewModel : Conductor.Collection.OneActive { + private readonly ICollection _artemisViewModels; + public RootViewModel(ICollection artemisViewModels) { + _artemisViewModels = artemisViewModels; // Add the built-in items Items.AddRange(artemisViewModels); // Activate the home item - ActiveItem = artemisViewModels.First(v => v.GetType() == typeof(HomeViewModel)); + ActiveItem = _artemisViewModels.First(v => v.GetType() == typeof(HomeViewModel)); + } + + public bool MenuOpen { get; set; } + + public void NavigateToHome() + { + ActivateItem(_artemisViewModels.First(v => v.GetType() == typeof(HomeViewModel))); + MenuOpen = false; + } + + public void NavigateToNews() + { + } + + public void NavigateToWorkshop() + { + } + + public void NavigateToSettings() + { + ActivateItem(_artemisViewModels.First(v => v.GetType() == typeof(SettingsViewModel))); + MenuOpen = false; } } } \ No newline at end of file diff --git a/src/Artemis.UI/ViewModels/SettingsViewModel.cs b/src/Artemis.UI/ViewModels/SettingsViewModel.cs new file mode 100644 index 000000000..97f6dd8ec --- /dev/null +++ b/src/Artemis.UI/ViewModels/SettingsViewModel.cs @@ -0,0 +1,10 @@ +using Artemis.UI.ViewModels.Interfaces; +using Stylet; + +namespace Artemis.UI.ViewModels +{ + public class SettingsViewModel : Screen, ISettingsViewModel + { + public string Title => "Settings"; + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Views/RootView.xaml b/src/Artemis.UI/Views/RootView.xaml index bc1ab4a6e..f1169de2c 100644 --- a/src/Artemis.UI/Views/RootView.xaml +++ b/src/Artemis.UI/Views/RootView.xaml @@ -13,7 +13,8 @@ Title="Artemis" d:DesignHeight="639.411" d:DesignWidth="1113.251" - d:DataContext="{d:DesignInstance vms:RootViewModel}"> + d:DataContext="{d:DesignInstance vms:RootViewModel}" + Icon="/Artemis.UI;component/Resources/logo-512.png"> @@ -75,9 +76,82 @@ HorizontalAlignment="Right" Margin="16" IsChecked="{Binding ElementName=MenuToggleButton, Path=IsChecked, Mode=TwoWay}" /> - - + + + + + + + Home + + + + + + News + + + + + + Workshop + + + + + + Settings + + + + + + Modules + + + + + + + + Home + + + + + + News + + + + + + Workshop + + + + + + Settings + + + + + @@ -87,7 +161,7 @@ DockPanel.Dock="Top"> + + \ No newline at end of file