mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Started layout editor implementation
Rearranged VMs/Views Updated RGB.NET
This commit is contained in:
parent
2fd5941ff3
commit
1146de1fc5
@ -73,20 +73,20 @@
|
||||
<Reference Include="Ninject.Extensions.Factory, Version=3.3.2.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Ninject.Extensions.Factory.3.3.2\lib\net45\Ninject.Extensions.Factory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Brushes, Version=0.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Brushes.0.1.22\lib\net45\RGB.NET.Brushes.dll</HintPath>
|
||||
<Reference Include="RGB.NET.Brushes, Version=0.1.25.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Brushes.0.1.25\lib\net45\RGB.NET.Brushes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Core, Version=0.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Core.0.1.22\lib\net45\RGB.NET.Core.dll</HintPath>
|
||||
<Reference Include="RGB.NET.Core, Version=0.1.25.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Core.0.1.25\lib\net45\RGB.NET.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Decorators, Version=0.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Decorators.0.1.22\lib\net45\RGB.NET.Decorators.dll</HintPath>
|
||||
<Reference Include="RGB.NET.Decorators, Version=0.1.25.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Decorators.0.1.25\lib\net45\RGB.NET.Decorators.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Devices.Corsair, Version=0.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Devices.Corsair.0.1.22\lib\net45\RGB.NET.Devices.Corsair.dll</HintPath>
|
||||
<Reference Include="RGB.NET.Devices.Corsair, Version=0.1.25.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Devices.Corsair.0.1.25\lib\net45\RGB.NET.Devices.Corsair.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Groups, Version=0.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Groups.0.1.22\lib\net45\RGB.NET.Groups.dll</HintPath>
|
||||
<Reference Include="RGB.NET.Groups, Version=0.1.25.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Groups.0.1.25\lib\net45\RGB.NET.Groups.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Stylet, Version=1.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Stylet.1.1.22\lib\net45\Stylet.dll</HintPath>
|
||||
@ -99,6 +99,9 @@
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\net47\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
|
||||
@ -1,27 +1,31 @@
|
||||
using System.Linq;
|
||||
using Artemis.Core.Exceptions;
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
using Artemis.Core.Plugins.Models;
|
||||
using Artemis.Storage.Repositories;
|
||||
using Ninject.Activation;
|
||||
|
||||
namespace Artemis.Core.Ninject
|
||||
{
|
||||
public class PluginSettingsProvider : Provider<PluginSettings>
|
||||
internal class PluginSettingsProvider : Provider<PluginSettings>
|
||||
{
|
||||
private readonly ISettingRepository _settingRepository;
|
||||
private readonly IPluginSettingRepository _pluginSettingRepository;
|
||||
|
||||
public PluginSettingsProvider(ISettingRepository settingRepository)
|
||||
internal PluginSettingsProvider(IPluginSettingRepository pluginSettingRepository)
|
||||
{
|
||||
_settingRepository = settingRepository;
|
||||
_pluginSettingRepository = pluginSettingRepository;
|
||||
}
|
||||
|
||||
protected override PluginSettings CreateInstance(IContext context)
|
||||
{
|
||||
var pluginInfo = context.Request.ParentRequest?.Parameters.FirstOrDefault(p => p.Name == "PluginInfo")?.GetValue(context, null) as PluginInfo;
|
||||
var parentRequest = context.Request.ParentRequest;
|
||||
if (parentRequest == null || !typeof(Plugin).IsAssignableFrom(parentRequest.Service))
|
||||
throw new ArtemisCoreException("PluginSettings can only be injected into a plugin");
|
||||
var pluginInfo = parentRequest.Parameters.FirstOrDefault(p => p.Name == "PluginInfo")?.GetValue(context, null) as PluginInfo;
|
||||
if (pluginInfo == null)
|
||||
throw new ArtemisCoreException("A plugin needs to be initialized with PluginInfo as a parameter");
|
||||
|
||||
return new PluginSettings(pluginInfo, _settingRepository);
|
||||
return new PluginSettings(pluginInfo, _pluginSettingRepository);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8,17 +8,17 @@ namespace Artemis.Core.Plugins.Models
|
||||
public class PluginSetting<T>
|
||||
{
|
||||
private readonly PluginInfo _pluginInfo;
|
||||
private readonly SettingEntity _settingEntity;
|
||||
private readonly ISettingRepository _settingRepository;
|
||||
private readonly PluginSettingEntity _pluginSettingEntity;
|
||||
private readonly IPluginSettingRepository _pluginSettingRepository;
|
||||
|
||||
internal PluginSetting(PluginInfo pluginInfo, ISettingRepository settingRepository, SettingEntity settingEntity)
|
||||
internal PluginSetting(PluginInfo pluginInfo, IPluginSettingRepository pluginSettingRepository, PluginSettingEntity pluginSettingEntity)
|
||||
{
|
||||
_pluginInfo = pluginInfo;
|
||||
_settingRepository = settingRepository;
|
||||
_settingEntity = settingEntity;
|
||||
_pluginSettingRepository = pluginSettingRepository;
|
||||
_pluginSettingEntity = pluginSettingEntity;
|
||||
|
||||
Name = settingEntity.Name;
|
||||
Value = JsonConvert.DeserializeObject<T>(settingEntity.Value);
|
||||
Name = pluginSettingEntity.Name;
|
||||
Value = JsonConvert.DeserializeObject<T>(pluginSettingEntity.Value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -34,14 +34,14 @@ namespace Artemis.Core.Plugins.Models
|
||||
/// <summary>
|
||||
/// Determines whether the setting has been changed
|
||||
/// </summary>
|
||||
public bool HasChanged => JsonConvert.SerializeObject(Value) != _settingEntity.Value;
|
||||
public bool HasChanged => JsonConvert.SerializeObject(Value) != _pluginSettingEntity.Value;
|
||||
|
||||
/// <summary>
|
||||
/// Resets the setting to the last saved value
|
||||
/// </summary>
|
||||
public void RejectChanges()
|
||||
{
|
||||
Value = JsonConvert.DeserializeObject<T>(_settingEntity.Value);
|
||||
Value = JsonConvert.DeserializeObject<T>(_pluginSettingEntity.Value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -49,8 +49,8 @@ namespace Artemis.Core.Plugins.Models
|
||||
/// </summary>
|
||||
public void Save()
|
||||
{
|
||||
_settingEntity.Value = JsonConvert.SerializeObject(Value);
|
||||
_settingRepository.Save();
|
||||
_pluginSettingEntity.Value = JsonConvert.SerializeObject(Value);
|
||||
_pluginSettingRepository.Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -59,8 +59,8 @@ namespace Artemis.Core.Plugins.Models
|
||||
/// <returns></returns>
|
||||
public async Task SaveAsync()
|
||||
{
|
||||
_settingEntity.Value = JsonConvert.SerializeObject(Value);
|
||||
await _settingRepository.SaveAsync();
|
||||
_pluginSettingEntity.Value = JsonConvert.SerializeObject(Value);
|
||||
await _pluginSettingRepository.SaveAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -9,27 +9,27 @@ namespace Artemis.Core.Plugins.Models
|
||||
public class PluginSettings
|
||||
{
|
||||
private readonly PluginInfo _pluginInfo;
|
||||
private readonly ISettingRepository _settingRepository;
|
||||
private readonly Dictionary<string, SettingEntity> _settingEntities;
|
||||
private readonly IPluginSettingRepository _pluginSettingRepository;
|
||||
private readonly Dictionary<string, PluginSettingEntity> _settingEntities;
|
||||
|
||||
public PluginSettings(PluginInfo pluginInfo, ISettingRepository settingRepository)
|
||||
internal PluginSettings(PluginInfo pluginInfo, IPluginSettingRepository pluginSettingRepository)
|
||||
{
|
||||
_pluginInfo = pluginInfo;
|
||||
_settingRepository = settingRepository;
|
||||
_settingEntities = settingRepository.GetByPluginGuid(_pluginInfo.Guid).ToDictionary(se => se.Name);
|
||||
_pluginSettingRepository = pluginSettingRepository;
|
||||
_settingEntities = pluginSettingRepository.GetByPluginGuid(_pluginInfo.Guid).ToDictionary(se => se.Name);
|
||||
}
|
||||
|
||||
public PluginSetting<T> GetSetting<T>(string name, T defaultValue = default(T))
|
||||
{
|
||||
if (_settingEntities.ContainsKey(name))
|
||||
return new PluginSetting<T>(_pluginInfo, _settingRepository, _settingEntities[name]);
|
||||
|
||||
var settingEntity = new SettingEntity {Name = name, PluginGuid = _pluginInfo.Guid, Value = JsonConvert.SerializeObject(defaultValue)};
|
||||
_settingRepository.Add(settingEntity);
|
||||
_settingRepository.Save();
|
||||
return new PluginSetting<T>(_pluginInfo, _pluginSettingRepository, _settingEntities[name]);
|
||||
|
||||
var settingEntity = new PluginSettingEntity {Name = name, PluginGuid = _pluginInfo.Guid, Value = JsonConvert.SerializeObject(defaultValue)};
|
||||
_pluginSettingRepository.Add(settingEntity);
|
||||
_pluginSettingRepository.Save();
|
||||
|
||||
_settingEntities.Add(name, settingEntity);
|
||||
return GetSetting(name, defaultValue);
|
||||
return new PluginSetting<T>(_pluginInfo, _pluginSettingRepository, _settingEntities[name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8,6 +8,9 @@ using Color = System.Drawing.Color;
|
||||
|
||||
namespace Artemis.Core.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides Artemis's core update loop
|
||||
/// </summary>
|
||||
public class CoreService : ICoreService
|
||||
{
|
||||
private readonly IPluginService _pluginService;
|
||||
@ -19,7 +22,6 @@ namespace Artemis.Core.Services
|
||||
_rgbService = rgbService;
|
||||
_rgbService.Surface.Updating += SurfaceOnUpdating;
|
||||
|
||||
|
||||
Task.Run(Initialize);
|
||||
}
|
||||
|
||||
|
||||
@ -3,11 +3,13 @@ using System.Collections.ObjectModel;
|
||||
using Artemis.Core.Exceptions;
|
||||
using Artemis.Core.Models;
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
using Artemis.Core.Plugins.Interfaces;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
|
||||
namespace Artemis.Core.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides access to the main data model
|
||||
/// </summary>
|
||||
public class MainDataModelService : IMainDataModelService
|
||||
{
|
||||
private readonly List<DataModelExpansion> _dataModelExpansions;
|
||||
|
||||
@ -16,6 +16,9 @@ using Ninject.Parameters;
|
||||
|
||||
namespace Artemis.Core.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides access to plugin loading and unloading
|
||||
/// </summary>
|
||||
public class PluginService : IPluginService
|
||||
{
|
||||
private readonly IKernel _kernel;
|
||||
|
||||
@ -11,6 +11,9 @@ using RGB.NET.Groups;
|
||||
|
||||
namespace Artemis.Core.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides wrapped access the RGB.NET
|
||||
/// </summary>
|
||||
public class RgbService : IRgbService, IDisposable
|
||||
{
|
||||
private readonly List<IRGBDevice> _loadedDevices;
|
||||
|
||||
@ -7,6 +7,9 @@ using Artemis.Storage.Repositories;
|
||||
|
||||
namespace Artemis.Core.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides access to profile storage
|
||||
/// </summary>
|
||||
public class StorageService : IStorageService
|
||||
{
|
||||
private readonly IPluginService _pluginService;
|
||||
|
||||
@ -7,11 +7,12 @@
|
||||
<package id="Ninject.Extensions.ChildKernel" version="3.3.0" targetFramework="net461" />
|
||||
<package id="Ninject.Extensions.Conventions" version="3.3.0" targetFramework="net461" />
|
||||
<package id="Ninject.Extensions.Factory" version="3.3.2" targetFramework="net461" />
|
||||
<package id="RGB.NET.Brushes" version="0.1.22" targetFramework="net461" />
|
||||
<package id="RGB.NET.Core" version="0.1.22" targetFramework="net461" />
|
||||
<package id="RGB.NET.Decorators" version="0.1.22" targetFramework="net461" />
|
||||
<package id="RGB.NET.Devices.Corsair" version="0.1.22" targetFramework="net461" />
|
||||
<package id="RGB.NET.Groups" version="0.1.22" targetFramework="net461" />
|
||||
<package id="RGB.NET.Brushes" version="0.1.25" targetFramework="net472" />
|
||||
<package id="RGB.NET.Core" version="0.1.25" targetFramework="net472" />
|
||||
<package id="RGB.NET.Decorators" version="0.1.25" targetFramework="net472" />
|
||||
<package id="RGB.NET.Devices.Corsair" version="0.1.25" targetFramework="net472" />
|
||||
<package id="RGB.NET.Groups" version="0.1.25" targetFramework="net472" />
|
||||
<package id="Stylet" version="1.1.22" targetFramework="net461" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="4.5.1" targetFramework="net472" />
|
||||
<package id="System.ValueTuple" version="4.4.0" targetFramework="net472" />
|
||||
</packages>
|
||||
@ -38,9 +38,8 @@
|
||||
<Reference Include="QRCoder, Version=1.2.5.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\QRCoder.1.2.5\lib\net40\QRCoder.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Core, Version=0.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Core.0.1.22\lib\net45\RGB.NET.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<Reference Include="RGB.NET.Core, Version=0.1.25.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Core.0.1.25\lib\net45\RGB.NET.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Stylet, Version=1.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Stylet.1.1.22\lib\net45\Stylet.dll</HintPath>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="QRCoder" version="1.2.5" targetFramework="net461" />
|
||||
<package id="RGB.NET.Core" version="0.1.22" targetFramework="net461" />
|
||||
<package id="RGB.NET.Core" version="0.1.25" targetFramework="net472" />
|
||||
<package id="Stylet" version="1.1.22" targetFramework="net461" />
|
||||
<package id="System.ValueTuple" version="4.4.0" targetFramework="net472" />
|
||||
</packages>
|
||||
@ -38,9 +38,8 @@
|
||||
<Reference Include="QRCoder, Version=1.3.5.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\QRCoder.1.3.5\lib\net40\QRCoder.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Core, Version=0.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Core.0.1.22\lib\net45\RGB.NET.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<Reference Include="RGB.NET.Core, Version=0.1.25.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Core.0.1.25\lib\net45\RGB.NET.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Stylet, Version=1.1.17.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Stylet.1.1.17\lib\net45\Stylet.dll</HintPath>
|
||||
|
||||
@ -80,7 +80,7 @@ namespace Artemis.Plugins.Modules.General
|
||||
private void UpdateLedColor(Led led, double deltaTime)
|
||||
{
|
||||
if (_colors.ContainsKey(led))
|
||||
_colors[led] = ColorHelpers.ShiftColor(_colors[led], (int) (deltaTime * 1000));
|
||||
_colors[led] = ColorHelpers.ShiftColor(_colors[led], (int) (deltaTime * 200));
|
||||
else
|
||||
_colors[led] = ColorHelpers.GetRandomRainbowColor();
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="QRCoder" version="1.3.5" targetFramework="net461" />
|
||||
<package id="RGB.NET.Core" version="0.1.22" targetFramework="net461" />
|
||||
<package id="RGB.NET.Core" version="0.1.25" targetFramework="net472" />
|
||||
<package id="Stylet" version="1.1.17" targetFramework="net461" />
|
||||
<package id="System.Drawing.Common" version="4.5.0" targetFramework="net461" />
|
||||
<package id="System.ValueTuple" version="4.4.0" targetFramework="net472" />
|
||||
|
||||
@ -9,6 +9,9 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.4" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Migrations\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
13
src/Artemis.Storage/Entities/PluginSettingEntity.cs
Normal file
13
src/Artemis.Storage/Entities/PluginSettingEntity.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Artemis.Storage.Entities
|
||||
{
|
||||
public class PluginSettingEntity
|
||||
{
|
||||
public Guid PluginGuid { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,8 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Artemis.Storage.Entities
|
||||
namespace Artemis.Storage.Entities
|
||||
{
|
||||
public class SettingEntity
|
||||
{
|
||||
public Guid PluginGuid { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
[DbContext(typeof(StorageContext))]
|
||||
[Migration("20190417180145_InitialCreate")]
|
||||
[Migration("20190429131614_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@ -110,6 +110,19 @@ namespace Artemis.Storage.Migrations
|
||||
b.ToTable("Leds");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.PluginSettingEntity", b =>
|
||||
{
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<Guid>("PluginGuid");
|
||||
|
||||
b.Property<string>("Value");
|
||||
|
||||
b.HasKey("Name", "PluginGuid");
|
||||
|
||||
b.ToTable("PluginSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b =>
|
||||
{
|
||||
b.Property<string>("Guid")
|
||||
@ -132,13 +145,12 @@ namespace Artemis.Storage.Migrations
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.SettingEntity", b =>
|
||||
{
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<Guid>("PluginGuid");
|
||||
b.Property<string>("Name")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Value");
|
||||
|
||||
b.HasKey("Name", "PluginGuid");
|
||||
b.HasKey("Name");
|
||||
|
||||
b.ToTable("Settings");
|
||||
});
|
||||
@ -28,7 +28,7 @@ namespace Artemis.Storage.Migrations
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Settings",
|
||||
name: "PluginSettings",
|
||||
columns: table => new
|
||||
{
|
||||
PluginGuid = table.Column<Guid>(nullable: false),
|
||||
@ -37,7 +37,19 @@ namespace Artemis.Storage.Migrations
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Settings", x => new { x.Name, x.PluginGuid });
|
||||
table.PrimaryKey("PK_PluginSettings", x => new { x.Name, x.PluginGuid });
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Settings",
|
||||
columns: table => new
|
||||
{
|
||||
Name = table.Column<string>(nullable: false),
|
||||
Value = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Settings", x => x.Name);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
@ -181,6 +193,9 @@ namespace Artemis.Storage.Migrations
|
||||
migrationBuilder.DropTable(
|
||||
name: "Leds");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PluginSettings");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Profiles");
|
||||
|
||||
@ -108,6 +108,19 @@ namespace Artemis.Storage.Migrations
|
||||
b.ToTable("Leds");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.PluginSettingEntity", b =>
|
||||
{
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<Guid>("PluginGuid");
|
||||
|
||||
b.Property<string>("Value");
|
||||
|
||||
b.HasKey("Name", "PluginGuid");
|
||||
|
||||
b.ToTable("PluginSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b =>
|
||||
{
|
||||
b.Property<string>("Guid")
|
||||
@ -130,13 +143,12 @@ namespace Artemis.Storage.Migrations
|
||||
|
||||
modelBuilder.Entity("Artemis.Storage.Entities.SettingEntity", b =>
|
||||
{
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<Guid>("PluginGuid");
|
||||
b.Property<string>("Name")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Value");
|
||||
|
||||
b.HasKey("Name", "PluginGuid");
|
||||
b.HasKey("Name");
|
||||
|
||||
b.ToTable("Settings");
|
||||
});
|
||||
|
||||
18
src/Artemis.Storage/Repositories/IPluginSettingRepository.cs
Normal file
18
src/Artemis.Storage/Repositories/IPluginSettingRepository.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Storage.Entities;
|
||||
|
||||
namespace Artemis.Storage.Repositories
|
||||
{
|
||||
public interface IPluginSettingRepository : IRepository
|
||||
{
|
||||
void Add(PluginSettingEntity pluginSettingEntity);
|
||||
List<PluginSettingEntity> GetByPluginGuid(Guid pluginGuid);
|
||||
Task<List<PluginSettingEntity>> GetByPluginGuidAsync(Guid pluginGuid);
|
||||
PluginSettingEntity GetByNameAndPluginGuid(string name, Guid pluginGuid);
|
||||
Task<PluginSettingEntity> GetByNameAndPluginGuidAsync(string name, Guid pluginGuid);
|
||||
void Save();
|
||||
Task SaveAsync();
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Storage.Entities;
|
||||
|
||||
@ -8,12 +6,11 @@ namespace Artemis.Storage.Repositories
|
||||
{
|
||||
public interface ISettingRepository : IRepository
|
||||
{
|
||||
IQueryable<SettingEntity> GetAll();
|
||||
List<SettingEntity> GetByPluginGuid(Guid pluginGuid);
|
||||
void Add(SettingEntity settingEntity);
|
||||
Task<List<SettingEntity>> GetByPluginGuidAsync(Guid pluginGuid);
|
||||
Task<SettingEntity> GetByNameAndPluginGuid(string name, Guid pluginGuid);
|
||||
Task<SettingEntity> GetByName(string name);
|
||||
SettingEntity Get(string name);
|
||||
Task<SettingEntity> GetAsync(string name);
|
||||
List<SettingEntity> GetAll();
|
||||
Task<List<SettingEntity>> GetAllAsync();
|
||||
void Save();
|
||||
Task SaveAsync();
|
||||
}
|
||||
|
||||
55
src/Artemis.Storage/Repositories/PluginSettingRepository.cs
Normal file
55
src/Artemis.Storage/Repositories/PluginSettingRepository.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Storage.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Artemis.Storage.Repositories
|
||||
{
|
||||
public class PluginSettingRepository : IPluginSettingRepository
|
||||
{
|
||||
private readonly StorageContext _dbContext;
|
||||
|
||||
internal PluginSettingRepository()
|
||||
{
|
||||
_dbContext = new StorageContext();
|
||||
_dbContext.Database.EnsureCreated();
|
||||
}
|
||||
|
||||
public void Add(PluginSettingEntity pluginSettingEntity)
|
||||
{
|
||||
_dbContext.PluginSettings.Add(pluginSettingEntity);
|
||||
}
|
||||
|
||||
public List<PluginSettingEntity> GetByPluginGuid(Guid pluginGuid)
|
||||
{
|
||||
return _dbContext.PluginSettings.Where(p => p.PluginGuid == pluginGuid).ToList();
|
||||
}
|
||||
|
||||
public async Task<List<PluginSettingEntity>> GetByPluginGuidAsync(Guid pluginGuid)
|
||||
{
|
||||
return await _dbContext.PluginSettings.Where(p => p.PluginGuid == pluginGuid).ToListAsync();
|
||||
}
|
||||
|
||||
public PluginSettingEntity GetByNameAndPluginGuid(string name, Guid pluginGuid)
|
||||
{
|
||||
return _dbContext.PluginSettings.FirstOrDefault(p => p.Name == name && p.PluginGuid == pluginGuid);
|
||||
}
|
||||
|
||||
public async Task<PluginSettingEntity> GetByNameAndPluginGuidAsync(string name, Guid pluginGuid)
|
||||
{
|
||||
return await _dbContext.PluginSettings.FirstOrDefaultAsync(p => p.Name == name && p.PluginGuid == pluginGuid);
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
_dbContext.SaveChanges();
|
||||
}
|
||||
|
||||
public async Task SaveAsync()
|
||||
{
|
||||
await _dbContext.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Storage.Entities;
|
||||
@ -17,36 +16,31 @@ namespace Artemis.Storage.Repositories
|
||||
_dbContext.Database.EnsureCreated();
|
||||
}
|
||||
|
||||
public IQueryable<SettingEntity> GetAll()
|
||||
{
|
||||
return _dbContext.Settings;
|
||||
}
|
||||
|
||||
public List<SettingEntity> GetByPluginGuid(Guid pluginGuid)
|
||||
{
|
||||
return _dbContext.Settings.Where(p => p.PluginGuid == pluginGuid).ToList();
|
||||
}
|
||||
|
||||
public void Add(SettingEntity settingEntity)
|
||||
{
|
||||
_dbContext.Settings.Add(settingEntity);
|
||||
}
|
||||
|
||||
public async Task<List<SettingEntity>> GetByPluginGuidAsync(Guid pluginGuid)
|
||||
public SettingEntity Get(string name)
|
||||
{
|
||||
return await _dbContext.Settings.Where(p => p.PluginGuid == pluginGuid).ToListAsync();
|
||||
return _dbContext.Settings.FirstOrDefault(p => p.Name == name);
|
||||
}
|
||||
|
||||
public async Task<SettingEntity> GetByNameAndPluginGuid(string name, Guid pluginGuid)
|
||||
{
|
||||
return await _dbContext.Settings.FirstOrDefaultAsync(p => p.Name == name && p.PluginGuid == pluginGuid);
|
||||
}
|
||||
|
||||
public async Task<SettingEntity> GetByName(string name)
|
||||
public async Task<SettingEntity> GetAsync(string name)
|
||||
{
|
||||
return await _dbContext.Settings.FirstOrDefaultAsync(p => p.Name == name);
|
||||
}
|
||||
|
||||
public List<SettingEntity> GetAll()
|
||||
{
|
||||
return _dbContext.Settings.ToList();
|
||||
}
|
||||
|
||||
public async Task<List<SettingEntity>> GetAllAsync()
|
||||
{
|
||||
return await _dbContext.Settings.ToListAsync();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
_dbContext.SaveChanges();
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using Artemis.Storage.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SQLitePCL;
|
||||
|
||||
namespace Artemis.Storage
|
||||
{
|
||||
@ -10,23 +10,26 @@ namespace Artemis.Storage
|
||||
{
|
||||
public DbSet<ProfileEntity> Profiles { get; set; }
|
||||
public DbSet<SettingEntity> Settings { get; set; }
|
||||
public DbSet<PluginSettingEntity> PluginSettings { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
#if DEBUG
|
||||
// var dbLocation = @"C:\Repos\Artemis\src\Artemis.Storage\Storage.db";
|
||||
#if DEBUG
|
||||
var dbLocation = Path.GetFullPath(Path.Combine(Assembly.GetEntryAssembly().Location, @"..\..\..\..\Artemis.Storage\Storage.db"));
|
||||
#else
|
||||
#else
|
||||
var dbLocation = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\Artemis\\Storage.db";
|
||||
#endif
|
||||
#endif
|
||||
optionsBuilder.UseSqlite("Data Source=" + dbLocation);
|
||||
|
||||
// Requires Microsoft.Data.Sqlite in the startup project
|
||||
SQLitePCL.Batteries.Init();
|
||||
Batteries.Init();
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<SettingEntity>().HasKey(s => new {s.Name, s.PluginGuid});
|
||||
modelBuilder.Entity<SettingEntity>().HasKey(s => s.Name);
|
||||
modelBuilder.Entity<PluginSettingEntity>().HasKey(s => new {s.Name, s.PluginGuid});
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,20 +99,44 @@
|
||||
<Reference Include="PropertyChanged, Version=2.6.1.0, Culture=neutral, PublicKeyToken=ee3ee20bcf148ddd, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\PropertyChanged.Fody.2.6.1\lib\net452\PropertyChanged.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Brushes, Version=0.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Brushes.0.1.22\lib\net45\RGB.NET.Brushes.dll</HintPath>
|
||||
<Reference Include="RGB.NET.Brushes, Version=0.1.25.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Brushes.0.1.25\lib\net45\RGB.NET.Brushes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Core, Version=0.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Core.0.1.22\lib\net45\RGB.NET.Core.dll</HintPath>
|
||||
<Reference Include="RGB.NET.Core, Version=0.1.25.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Core.0.1.25\lib\net45\RGB.NET.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Decorators, Version=0.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Decorators.0.1.22\lib\net45\RGB.NET.Decorators.dll</HintPath>
|
||||
<Reference Include="RGB.NET.Decorators, Version=0.1.25.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Decorators.0.1.25\lib\net45\RGB.NET.Decorators.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Devices.Corsair, Version=0.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Devices.Corsair.0.1.22\lib\net45\RGB.NET.Devices.Corsair.dll</HintPath>
|
||||
<Reference Include="RGB.NET.Devices.Corsair, Version=0.1.25.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Devices.Corsair.0.1.25\lib\net45\RGB.NET.Devices.Corsair.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RGB.NET.Groups, Version=0.1.22.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Groups.0.1.22\lib\net45\RGB.NET.Groups.dll</HintPath>
|
||||
<Reference Include="RGB.NET.Groups, Version=0.1.25.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RGB.NET.Groups.0.1.25\lib\net45\RGB.NET.Groups.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SharpVectors.Converters.Wpf, Version=1.3.0.0, Culture=neutral, PublicKeyToken=b532964b8548be77, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpVectors.Reloaded.1.3.0\lib\net40\SharpVectors.Converters.Wpf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SharpVectors.Core, Version=1.3.0.0, Culture=neutral, PublicKeyToken=7407205e337c98ef, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpVectors.Reloaded.1.3.0\lib\net40\SharpVectors.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SharpVectors.Css, Version=1.3.0.0, Culture=neutral, PublicKeyToken=7a46e3f532fdb787, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpVectors.Reloaded.1.3.0\lib\net40\SharpVectors.Css.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SharpVectors.Dom, Version=1.3.0.0, Culture=neutral, PublicKeyToken=517340b6277b1a7a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpVectors.Reloaded.1.3.0\lib\net40\SharpVectors.Dom.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SharpVectors.Model, Version=1.3.0.0, Culture=neutral, PublicKeyToken=2236cfc76b505845, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpVectors.Reloaded.1.3.0\lib\net40\SharpVectors.Model.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SharpVectors.Rendering.Gdi, Version=1.3.0.0, Culture=neutral, PublicKeyToken=03902092284347e3, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpVectors.Reloaded.1.3.0\lib\net40\SharpVectors.Rendering.Gdi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SharpVectors.Rendering.Wpf, Version=1.3.0.0, Culture=neutral, PublicKeyToken=d0902381100df30e, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpVectors.Reloaded.1.3.0\lib\net40\SharpVectors.Rendering.Wpf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SharpVectors.Runtime.Wpf, Version=1.3.0.0, Culture=neutral, PublicKeyToken=d16e717f0a981fb9, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpVectors.Reloaded.1.3.0\lib\net40\SharpVectors.Runtime.Wpf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SQLitePCLRaw.batteries_green, Version=1.1.12.351, Culture=neutral, PublicKeyToken=a84b7dcfb1391f7f, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SQLitePCLRaw.bundle_green.1.1.12\lib\net45\SQLitePCLRaw.batteries_green.dll</HintPath>
|
||||
@ -162,17 +186,22 @@
|
||||
<Compile Include="Services\Interfaces\IArtemisUIService.cs" />
|
||||
<Compile Include="Stylet\ArtemisViewManager.cs" />
|
||||
<Compile Include="Stylet\NinjectBootstrapper.cs" />
|
||||
<Compile Include="ViewModels\Settings\DeviceSettingsViewModel.cs" />
|
||||
<Compile Include="ViewModels\Screens\EditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\Interfaces\IEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\Controls\RgbDevice\RgbDeviceViewModel.cs" />
|
||||
<Compile Include="ViewModels\Controls\RgbDevice\RgbLedViewModel.cs" />
|
||||
<Compile Include="ViewModels\Controls\Settings\RgbDeviceSettingsViewModel.cs" />
|
||||
<Compile Include="ViewModels\Interfaces\IHomeViewModel.cs" />
|
||||
<Compile Include="ViewModels\Interfaces\IArtemisViewModel.cs" />
|
||||
<Compile Include="ViewModels\HomeViewModel.cs" />
|
||||
<Compile Include="ViewModels\Interfaces\IScreenViewModel.cs" />
|
||||
<Compile Include="ViewModels\Screens\HomeViewModel.cs" />
|
||||
<Compile Include="ViewModels\Interfaces\ISettingsViewModel.cs" />
|
||||
<Compile Include="ViewModels\RootViewModel.cs" />
|
||||
<Compile Include="ViewModels\Screens\RootViewModel.cs" />
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ViewModels\Settings\SettingsViewModel.cs" />
|
||||
<Compile Include="ViewModels\Screens\SettingsViewModel.cs" />
|
||||
<Compile Include="ViewModels\Controls\Editor\SurfaceEditorViewModel.cs" />
|
||||
<Page Include="Styles\Visualizers\LedVisualizer.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@ -185,19 +214,35 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\HomeView.xaml">
|
||||
<Page Include="Views\Screens\HomeView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\RootView.xaml">
|
||||
<Page Include="Views\Controls\RgbDevice\RgbDeviceView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Settings\DeviceSettingsView.xaml">
|
||||
<Page Include="Views\Controls\RgbDevice\RgbLedView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Settings\SettingsView.xaml">
|
||||
<Page Include="Views\Screens\RootView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Screens\EditorView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\Controls\Settings\RgbDeviceSettingsView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Screens\SettingsView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\Controls\Editor\SurfaceEditorView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
|
||||
@ -4,6 +4,7 @@ using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.UI.Ninject;
|
||||
using Artemis.UI.Stylet;
|
||||
using Artemis.UI.ViewModels;
|
||||
using Artemis.UI.ViewModels.Screens;
|
||||
using Ninject;
|
||||
|
||||
namespace Artemis.UI
|
||||
|
||||
@ -15,7 +15,7 @@ namespace Artemis.UI.Ninject
|
||||
{
|
||||
x.FromThisAssembly()
|
||||
.SelectAllClasses()
|
||||
.InheritedFrom<IArtemisViewModel>()
|
||||
.InheritedFrom<IScreenViewModel>()
|
||||
.BindAllInterfaces();
|
||||
});
|
||||
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using Artemis.Core.Events;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.UI.ViewModels.Controls.RgbDevice;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Controls.Editor
|
||||
{
|
||||
public class SurfaceEditorViewModel
|
||||
{
|
||||
private readonly IRgbService _rgbService;
|
||||
|
||||
public SurfaceEditorViewModel(IRgbService rgbService)
|
||||
{
|
||||
Devices = new ObservableCollection<RgbDeviceViewModel>();
|
||||
|
||||
_rgbService = rgbService;
|
||||
_rgbService.DeviceLoaded += RgbServiceOnDeviceLoaded;
|
||||
_rgbService.Surface.Updated += SurfaceOnUpdated;
|
||||
|
||||
foreach (var surfaceDevice in _rgbService.Surface.Devices)
|
||||
Devices.Add(new RgbDeviceViewModel(surfaceDevice));
|
||||
}
|
||||
|
||||
|
||||
public ObservableCollection<RgbDeviceViewModel> Devices { get; set; }
|
||||
|
||||
private void RgbServiceOnDeviceLoaded(object sender, DeviceEventArgs e)
|
||||
{
|
||||
if (Devices.All(d => d.Device != e.Device))
|
||||
Devices.Add(new RgbDeviceViewModel(e.Device));
|
||||
}
|
||||
|
||||
private void SurfaceOnUpdated(UpdatedEventArgs args)
|
||||
{
|
||||
foreach (var rgbDeviceViewModel in Devices)
|
||||
{
|
||||
rgbDeviceViewModel.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
using System.Collections.Generic;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Controls.RgbDevice
|
||||
{
|
||||
public class RgbDeviceViewModel
|
||||
{
|
||||
private readonly List<RgbLedViewModel> _leds;
|
||||
|
||||
public RgbDeviceViewModel(IRGBDevice device)
|
||||
{
|
||||
Device = device;
|
||||
_leds = new List<RgbLedViewModel>();
|
||||
|
||||
foreach (var led in Device)
|
||||
_leds.Add(new RgbLedViewModel(led));
|
||||
}
|
||||
|
||||
public IRGBDevice Device { get; }
|
||||
public IReadOnlyCollection<RgbLedViewModel> Leds => _leds.AsReadOnly();
|
||||
|
||||
public void Update()
|
||||
{
|
||||
foreach (var rgbLedViewModel in _leds)
|
||||
rgbLedViewModel.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using RGB.NET.Core;
|
||||
using SharpVectors.Converters;
|
||||
using SharpVectors.Renderers.Wpf;
|
||||
using Stylet;
|
||||
using Color = System.Windows.Media.Color;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Controls.RgbDevice
|
||||
{
|
||||
public class RgbLedViewModel : PropertyChangedBase
|
||||
{
|
||||
public RgbLedViewModel(Led led)
|
||||
{
|
||||
Led = led;
|
||||
|
||||
Execute.OnUIThread(CreateLedGeometry);
|
||||
Update();
|
||||
}
|
||||
|
||||
public Led Led { get; }
|
||||
|
||||
public double X { get; private set; }
|
||||
|
||||
public double Y { get; private set; }
|
||||
|
||||
public double Width { get; private set; }
|
||||
|
||||
public double Height { get; private set; }
|
||||
|
||||
public Color FillColor { get; set; }
|
||||
|
||||
public DrawingImage DisplayDrawing { get; private set; }
|
||||
|
||||
public string Tooltip => $"{Led.Id} - {Led.LedRectangle}";
|
||||
|
||||
private void CreateLedGeometry()
|
||||
{
|
||||
// Prepare the SVG for this LED
|
||||
var converter = new FileSvgReader(new WpfDrawingSettings {OptimizePath = true});
|
||||
if (Led.Image != null)
|
||||
{
|
||||
DisplayDrawing = new DrawingImage(converter.Read(Led.Image));
|
||||
}
|
||||
else
|
||||
{
|
||||
var relativeRectangle = new Rect(0, 0, Led.LedRectangle.Width, Led.LedRectangle.Height);
|
||||
Geometry geometry;
|
||||
switch (Led.Shape)
|
||||
{
|
||||
case Shape.Custom:
|
||||
geometry = Geometry.Parse(Led.ShapeData);
|
||||
break;
|
||||
case Shape.Rectangle:
|
||||
geometry = new RectangleGeometry(relativeRectangle, 2, 2);
|
||||
break;
|
||||
case Shape.Circle:
|
||||
geometry = new EllipseGeometry(relativeRectangle);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
var drawing = new GeometryDrawing(null, new Pen(null, 2), geometry);
|
||||
DisplayDrawing = new DrawingImage(drawing);
|
||||
}
|
||||
|
||||
NotifyOfPropertyChange(() => DisplayDrawing);
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
FillColor = Color.FromRgb((byte) Math.Round(255 * Led.Color.R), (byte) Math.Round(255 * Led.Color.G), (byte) Math.Round(255 * Led.Color.B));
|
||||
X = Led.LedRectangle.X;
|
||||
Y = Led.LedRectangle.Y;
|
||||
Width = Led.LedRectangle.Width;
|
||||
Height = Led.LedRectangle.Height;
|
||||
|
||||
if (DisplayDrawing != null)
|
||||
{
|
||||
Execute.OnUIThread(() =>
|
||||
{
|
||||
if (DisplayDrawing.Drawing is GeometryDrawing geometryDrawing)
|
||||
{
|
||||
geometryDrawing.Brush = new SolidColorBrush(FillColor) {Opacity = 0.6};
|
||||
geometryDrawing.Pen.Brush = new SolidColorBrush(FillColor);
|
||||
}
|
||||
else if (DisplayDrawing.Drawing is DrawingGroup drawingGroup)
|
||||
drawingGroup.OpacityMask = new SolidColorBrush(FillColor);
|
||||
});
|
||||
NotifyOfPropertyChange(() => DisplayDrawing);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
using Humanizer;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Controls.Settings
|
||||
{
|
||||
public class RgbDeviceSettingsViewModel
|
||||
{
|
||||
public IRGBDevice Device { get; }
|
||||
|
||||
public RgbDeviceSettingsViewModel(IRGBDevice device)
|
||||
{
|
||||
Device = device;
|
||||
|
||||
Type = Device.DeviceInfo.DeviceType.ToString().Humanize();
|
||||
Name = Device.DeviceInfo.Model;
|
||||
Manufacturer = Device.DeviceInfo.Manufacturer;
|
||||
Enabled = true;
|
||||
}
|
||||
|
||||
public string Type { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
}
|
||||
}
|
||||
7
src/Artemis.UI/ViewModels/Interfaces/IEditorViewModel.cs
Normal file
7
src/Artemis.UI/ViewModels/Interfaces/IEditorViewModel.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Artemis.UI.ViewModels.Interfaces
|
||||
{
|
||||
public interface IEditorViewModel : IScreenViewModel
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
namespace Artemis.UI.ViewModels.Interfaces
|
||||
{
|
||||
public interface IHomeViewModel : IArtemisViewModel
|
||||
public interface IHomeViewModel : IScreenViewModel
|
||||
{
|
||||
void OpenUrl(string url);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Artemis.UI.ViewModels.Interfaces
|
||||
{
|
||||
public interface IArtemisViewModel : IScreen
|
||||
public interface IScreenViewModel : IScreen
|
||||
{
|
||||
string Title { get; }
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
namespace Artemis.UI.ViewModels.Interfaces
|
||||
{
|
||||
public interface ISettingsViewModel : IArtemisViewModel
|
||||
public interface ISettingsViewModel : IScreenViewModel
|
||||
{
|
||||
}
|
||||
}
|
||||
18
src/Artemis.UI/ViewModels/Screens/EditorViewModel.cs
Normal file
18
src/Artemis.UI/ViewModels/Screens/EditorViewModel.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.UI.ViewModels.Controls.Editor;
|
||||
using Artemis.UI.ViewModels.Interfaces;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Screens
|
||||
{
|
||||
public class EditorViewModel : Screen, IEditorViewModel
|
||||
{
|
||||
public EditorViewModel(IRgbService rgbService)
|
||||
{
|
||||
SurfaceEditorViewModel = new SurfaceEditorViewModel(rgbService);
|
||||
}
|
||||
|
||||
public SurfaceEditorViewModel SurfaceEditorViewModel { get; set; }
|
||||
public string Title => "Editor";
|
||||
}
|
||||
}
|
||||
@ -3,7 +3,7 @@ using System.Diagnostics;
|
||||
using Artemis.UI.ViewModels.Interfaces;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels
|
||||
namespace Artemis.UI.ViewModels.Screens
|
||||
{
|
||||
public class HomeViewModel : Screen, IHomeViewModel
|
||||
{
|
||||
@ -5,20 +5,18 @@ using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
using Artemis.Core.Events;
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
using Artemis.Core.Plugins.Interfaces;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.UI.ViewModels.Interfaces;
|
||||
using Artemis.UI.ViewModels.Settings;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels
|
||||
namespace Artemis.UI.ViewModels.Screens
|
||||
{
|
||||
public class RootViewModel : Conductor<IScreen>.Collection.OneActive
|
||||
{
|
||||
private readonly ICollection<IArtemisViewModel> _artemisViewModels;
|
||||
private readonly ICollection<IScreenViewModel> _artemisViewModels;
|
||||
private readonly IPluginService _pluginService;
|
||||
|
||||
public RootViewModel(ICollection<IArtemisViewModel> artemisViewModels, IPluginService pluginService)
|
||||
public RootViewModel(ICollection<IScreenViewModel> artemisViewModels, IPluginService pluginService)
|
||||
{
|
||||
_artemisViewModels = artemisViewModels;
|
||||
_pluginService = pluginService;
|
||||
@ -104,6 +102,9 @@ namespace Artemis.UI.ViewModels
|
||||
case "Workshop":
|
||||
// ActivateItem(_artemisViewModels.First(v => v.GetType() == typeof(WorkshopViewModel)));
|
||||
break;
|
||||
case "Editor":
|
||||
ActivateItem(_artemisViewModels.First(v => v.GetType() == typeof(EditorViewModel)));
|
||||
break;
|
||||
case "Settings":
|
||||
ActivateItem(_artemisViewModels.First(v => v.GetType() == typeof(SettingsViewModel)));
|
||||
break;
|
||||
@ -1,28 +1,28 @@
|
||||
using System.Collections.Generic;
|
||||
using Artemis.Core.Events;
|
||||
using Artemis.Core.Events;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.UI.ViewModels.Controls.Settings;
|
||||
using Artemis.UI.ViewModels.Interfaces;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Settings
|
||||
namespace Artemis.UI.ViewModels.Screens
|
||||
{
|
||||
public class SettingsViewModel : Screen, ISettingsViewModel
|
||||
{
|
||||
public SettingsViewModel(IRgbService rgbService)
|
||||
{
|
||||
DeviceSettingsViewModels = new List<DeviceSettingsViewModel>();
|
||||
DeviceSettingsViewModels = new BindableCollection<RgbDeviceSettingsViewModel>();
|
||||
foreach (var device in rgbService.Surface.Devices)
|
||||
DeviceSettingsViewModels.Add(new DeviceSettingsViewModel(device));
|
||||
DeviceSettingsViewModels.Add(new RgbDeviceSettingsViewModel(device));
|
||||
|
||||
rgbService.DeviceLoaded += UpdateDevices;
|
||||
}
|
||||
|
||||
public List<DeviceSettingsViewModel> DeviceSettingsViewModels { get; set; }
|
||||
public BindableCollection<RgbDeviceSettingsViewModel> DeviceSettingsViewModels { get; set; }
|
||||
public string Title => "Settings";
|
||||
|
||||
private void UpdateDevices(object sender, DeviceEventArgs deviceEventArgs)
|
||||
{
|
||||
DeviceSettingsViewModels.Add(new DeviceSettingsViewModel(deviceEventArgs.Device));
|
||||
DeviceSettingsViewModels.Add(new RgbDeviceSettingsViewModel(deviceEventArgs.Device));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
using Humanizer;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace Artemis.UI.ViewModels.Settings
|
||||
{
|
||||
public class DeviceSettingsViewModel
|
||||
{
|
||||
private readonly IRGBDevice _device;
|
||||
|
||||
public DeviceSettingsViewModel(IRGBDevice device)
|
||||
{
|
||||
_device = device;
|
||||
|
||||
Type = _device.DeviceInfo.DeviceType.ToString().Humanize();
|
||||
Name = _device.DeviceInfo.Model;
|
||||
Manufacturer = _device.DeviceInfo.Manufacturer;
|
||||
Enabled = true;
|
||||
}
|
||||
|
||||
public string Type { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
}
|
||||
}
|
||||
33
src/Artemis.UI/Views/Controls/Editor/SurfaceEditorView.xaml
Normal file
33
src/Artemis.UI/Views/Controls/Editor/SurfaceEditorView.xaml
Normal file
@ -0,0 +1,33 @@
|
||||
<UserControl x:Class="Artemis.UI.Views.Controls.Editor.SurfaceEditorView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:editor="clr-namespace:Artemis.UI.ViewModels.Controls.Editor"
|
||||
xmlns:xaml="https://github.com/canton7/Stylet"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
d:DataContext="{d:DesignInstance editor:SurfaceEditorViewModel}">
|
||||
<Grid>
|
||||
<TextBlock>Surface editor view</TextBlock>
|
||||
<ItemsControl ItemsSource="{Binding Devices}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<Canvas />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemContainerStyle>
|
||||
<Style TargetType="ContentPresenter">
|
||||
<Setter Property="Canvas.Left" Value="{Binding Device.Location.X}" />
|
||||
<Setter Property="Canvas.Top" Value="{Binding Device.Location.Y}" />
|
||||
</Style>
|
||||
</ItemsControl.ItemContainerStyle>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ContentControl Width="{Binding Device.Size.Width}" Height="{Binding Device.Size.Height}" xaml:View.Model="{Binding }"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
31
src/Artemis.UI/Views/Controls/RgbDevice/RgbDeviceView.xaml
Normal file
31
src/Artemis.UI/Views/Controls/RgbDevice/RgbDeviceView.xaml
Normal file
@ -0,0 +1,31 @@
|
||||
<UserControl x:Class="Artemis.UI.Views.Controls.RgbDevice.RgbDeviceView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:rgbDevice="clr-namespace:Artemis.UI.ViewModels.Controls.RgbDevice"
|
||||
xmlns:xaml="https://github.com/canton7/Stylet"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance rgbDevice:RgbDeviceViewModel}"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<ItemsControl ItemsSource="{Binding Leds}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<Canvas />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemContainerStyle>
|
||||
<Style TargetType="ContentPresenter">
|
||||
<Setter Property="Canvas.Left" Value="{Binding Led.LedRectangle.X}" />
|
||||
<Setter Property="Canvas.Top" Value="{Binding Led.LedRectangle.Y}" />
|
||||
</Style>
|
||||
</ItemsControl.ItemContainerStyle>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ContentControl Width="{Binding Led.LedRectangle.Width}" Height="{Binding Led.LedRectangle.Width}" xaml:View.Model="{Binding}" ToolTip="{Binding Tooltip}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
12
src/Artemis.UI/Views/Controls/RgbDevice/RgbLedView.xaml
Normal file
12
src/Artemis.UI/Views/Controls/RgbDevice/RgbLedView.xaml
Normal file
@ -0,0 +1,12 @@
|
||||
<UserControl x:Class="Artemis.UI.Views.Controls.RgbDevice.RgbLedView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Artemis.UI.Views.Controls.RgbDevice"
|
||||
xmlns:rgbDevice="clr-namespace:Artemis.UI.ViewModels.Controls.RgbDevice"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance rgbDevice:RgbLedViewModel}"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Image Width="Auto" Height="Auto" Source="{Binding DisplayDrawing}" Margin="2" />
|
||||
</UserControl>
|
||||
@ -1,10 +1,10 @@
|
||||
<UserControl x:Class="Artemis.UI.Views.Settings.DeviceSettingsView"
|
||||
<UserControl x:Class="Artemis.UI.Views.Controls.Settings.RgbDeviceSettingsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:vms="clr-namespace:Artemis.UI.ViewModels.Settings"
|
||||
d:DataContext="{d:DesignInstance vms:DeviceSettingsViewModel}"
|
||||
xmlns:settings="clr-namespace:Artemis.UI.ViewModels.Controls.Settings"
|
||||
d:DataContext="{d:DesignInstance settings:RgbDeviceSettingsViewModel}"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
23
src/Artemis.UI/Views/Screens/EditorView.xaml
Normal file
23
src/Artemis.UI/Views/Screens/EditorView.xaml
Normal file
@ -0,0 +1,23 @@
|
||||
<UserControl x:Class="Artemis.UI.Views.Screens.EditorView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:screens="clr-namespace:Artemis.UI.ViewModels.Screens"
|
||||
xmlns:xaml="https://github.com/canton7/Stylet"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance screens:EditorViewModel}"
|
||||
d:DesignHeight="600" d:DesignWidth="600">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary
|
||||
Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<StackPanel Margin="16">
|
||||
<TextBlock>In the editor you can either edit your surface layout or edit a profile.</TextBlock>
|
||||
<ContentControl xaml:View.Model="{Binding SurfaceEditorViewModel}"/>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@ -1,4 +1,4 @@
|
||||
<UserControl x:Class="Artemis.UI.Views.HomeView"
|
||||
<UserControl x:Class="Artemis.UI.Views.Screens.HomeView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
@ -6,10 +6,11 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:vms="clr-namespace:Artemis.UI.ViewModels"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:screens="clr-namespace:Artemis.UI.ViewModels.Screens"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="574.026"
|
||||
d:DesignWidth="1029.87"
|
||||
d:DataContext="{d:DesignInstance vms:HomeViewModel, IsDesignTimeCreatable=True}">
|
||||
d:DataContext="{d:DesignInstance screens:HomeViewModel, IsDesignTimeCreatable=True}">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
@ -1,4 +1,4 @@
|
||||
<metro:MetroWindow x:Class="Artemis.UI.Views.RootView"
|
||||
<metro:MetroWindow x:Class="Artemis.UI.Views.Screens.RootView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
@ -10,13 +10,14 @@
|
||||
xmlns:models="clr-namespace:Artemis.Core.Plugins.Models;assembly=Artemis.Core"
|
||||
xmlns:interfaces="clr-namespace:Artemis.Core.Plugins.Interfaces;assembly=Artemis.Core"
|
||||
xmlns:abstract="clr-namespace:Artemis.Core.Plugins.Abstract;assembly=Artemis.Core"
|
||||
xmlns:screens="clr-namespace:Artemis.UI.ViewModels.Screens"
|
||||
mc:Ignorable="d"
|
||||
GlowBrush="{DynamicResource AccentColorBrush}"
|
||||
FontFamily="{StaticResource DefaultFont}"
|
||||
Title="Artemis"
|
||||
d:DesignHeight="639.411"
|
||||
d:DesignWidth="1113.251"
|
||||
d:DataContext="{d:DesignInstance vms:RootViewModel}"
|
||||
d:DataContext="{d:DesignInstance screens:RootViewModel}"
|
||||
Icon="/Artemis.UI;component/Resources/logo-512.png">
|
||||
<metro:MetroWindow.Resources>
|
||||
<DrawingImage x:Key="BowIcon">
|
||||
@ -106,6 +107,13 @@
|
||||
<TextBlock>Workshop</TextBlock>
|
||||
</StackPanel>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem x:Name="Editor">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Edit"
|
||||
Margin="0,0,8,0" />
|
||||
<TextBlock>Editor</TextBlock>
|
||||
</StackPanel>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem x:Name="Settings">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Kind="Settings"
|
||||
@ -1,11 +1,12 @@
|
||||
<UserControl x:Class="Artemis.UI.Views.Settings.SettingsView"
|
||||
<UserControl x:Class="Artemis.UI.Views.Screens.SettingsView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:screens="clr-namespace:Artemis.UI.ViewModels.Screens"
|
||||
xmlns:xaml="https://github.com/canton7/Stylet"
|
||||
mc:Ignorable="d"
|
||||
xmlns:vms="clr-namespace:Artemis.UI.ViewModels.Settings"
|
||||
d:DataContext="{d:DesignInstance vms:SettingsViewModel}"
|
||||
d:DataContext="{d:DesignInstance screens:SettingsViewModel}"
|
||||
d:DesignHeight="600" d:DesignWidth="600">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
@ -23,7 +24,14 @@
|
||||
|
||||
<TextBlock Style="{StaticResource MaterialDesignHeadlineTextBlock}">Devices</TextBlock>
|
||||
<Grid>
|
||||
<TextBlock>A list of plugins and options to disable them</TextBlock>
|
||||
<TextBlock>A list of devices and options to disable them</TextBlock>
|
||||
<ItemsControl ItemsSource="{Binding DeviceSettingsViewModels}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ContentControl xaml:View.Model="{Binding}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
|
||||
<TextBlock Style="{StaticResource MaterialDesignHeadlineTextBlock}">Plugins</TextBlock>
|
||||
@ -14,12 +14,13 @@
|
||||
<package id="Ninject.Extensions.Conventions" version="3.3.0" targetFramework="net461" />
|
||||
<package id="Ninject.Extensions.Factory" version="3.3.2" targetFramework="net461" />
|
||||
<package id="PropertyChanged.Fody" version="2.6.1" targetFramework="net461" />
|
||||
<package id="RGB.NET.Brushes" version="0.1.22" targetFramework="net461" />
|
||||
<package id="RGB.NET.Core" version="0.1.22" targetFramework="net461" />
|
||||
<package id="RGB.NET.Decorators" version="0.1.22" targetFramework="net461" />
|
||||
<package id="RGB.NET.Devices.Corsair" version="0.1.22" targetFramework="net461" />
|
||||
<package id="RGB.NET.Groups" version="0.1.22" targetFramework="net461" />
|
||||
<package id="RGB.NET.Brushes" version="0.1.25" targetFramework="net472" />
|
||||
<package id="RGB.NET.Core" version="0.1.25" targetFramework="net472" />
|
||||
<package id="RGB.NET.Decorators" version="0.1.25" targetFramework="net472" />
|
||||
<package id="RGB.NET.Devices.Corsair" version="0.1.25" targetFramework="net472" />
|
||||
<package id="RGB.NET.Groups" version="0.1.25" targetFramework="net472" />
|
||||
<package id="RGB.NET.Resources.Corsair" version="0.3.0.234" targetFramework="net461" />
|
||||
<package id="SharpVectors.Reloaded" version="1.3.0" targetFramework="net472" />
|
||||
<package id="SQLitePCLRaw.bundle_green" version="1.1.12" targetFramework="net472" />
|
||||
<package id="SQLitePCLRaw.core" version="1.1.12" targetFramework="net472" />
|
||||
<package id="SQLitePCLRaw.lib.e_sqlite3.linux" version="1.1.12" targetFramework="net472" />
|
||||
|
||||
64
src/Artemis.sln.DotSettings
Normal file
64
src/Artemis.sln.DotSettings
Normal file
@ -0,0 +1,64 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntelliSenseCompletingCharacters/CSharpCompletingCharacters/UpgradedFromVSSettings/@EntryValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeCleanup/RecentlyUsedProfile/@EntryValue">Built-in: Full Cleanup</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOR/@EntryValue">RequiredForMultiline</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOREACH/@EntryValue">RequiredForMultiline</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_IFELSE/@EntryValue">RequiredForMultiline</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INDENT_PREPROCESSOR_IF/@EntryValue">USUAL_INDENT</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LIMIT/@EntryValue">200</s:Int64>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/Generate/=Formatting/@KeyIndexDefined">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/Generate/=Formatting/Options/=UseNameOf/@EntryIndexedValue">True</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/Generate/=Implementations/@KeyIndexDefined">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=Mutable/@EntryIndexedValue">False</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/Generate/=Overrides/@KeyIndexDefined">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/Generate/=Overrides/Options/=Async/@EntryIndexedValue">False</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpAutoNaming/IsNotificationDisabled/@EntryValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FCONSTANT/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FFUNCTION/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FVARIABLE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FCLASS/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FCONSTRUCTOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FFUNCTION/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FGLOBAL_005FVARIABLE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FLABEL/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FLOCAL_005FCONSTRUCTOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FLOCAL_005FVARIABLE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FOBJECT_005FPROPERTY_005FOF_005FFUNCTION/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FPARAMETER/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FCLASS/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FENUM/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FENUM_005FMEMBER/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FINTERFACE/@EntryIndexedValue"><Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMIXED_005FENUM/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMODULE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMODULE_005FEXPORTED/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FMODULE_005FLOCAL/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPRIVATE_005FMEMBER_005FACCESSOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPRIVATE_005FSTATIC_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPRIVATE_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPRIVATE_005FTYPE_005FMETHOD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPROTECTED_005FMEMBER_005FACCESSOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPROTECTED_005FSTATIC_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPROTECTED_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPROTECTED_005FTYPE_005FMETHOD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FMEMBER_005FACCESSOR/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FSTATIC_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FPUBLIC_005FTYPE_005FMETHOD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FTYPE_005FALIAS/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=TS_005FTYPE_005FPARAMETER/@EntryIndexedValue"><Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FHTML_005FCONTROL/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FTAG_005FNAME/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/WebNaming/UserRules/=ASP_005FTAG_005FPREFIX/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=NAMESPACE_005FALIAS/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FFIELD/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FRESOURCE/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=leds/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
Loading…
x
Reference in New Issue
Block a user