Fixed some basic stuff and added images to devices

This commit is contained in:
DarthAffe committed 2017-01-29 20:07:11 +01:00
1 parent 2678d3f56d
commit 2d42bd85fc
12 files changed
+63 -25

No files matched your search

@@ -19,9 +19,6 @@ namespace RGB.NET.Devices.Corsair
/// </summary>
public override IRGBDeviceInfo DeviceInfo { get; }
/// <inheritdoc />
protected override Size InternalSize { get; set; }
#endregion
#region Constructors
@@ -45,7 +42,7 @@ namespace RGB.NET.Devices.Corsair
internal void Initialize()
{
InitializeLeds();
Rectangle ledRectangle = new Rectangle(this.Select(x => x.LedRectangle));
InternalSize = ledRectangle.Size + new Size(ledRectangle.Location.X, ledRectangle.Location.Y);
}
@@ -31,6 +31,9 @@ namespace RGB.NET.Devices.Corsair
/// <inheritdoc />
public string Model { get; }
/// <inheritdoc />
public Uri Image { get; protected set; }
/// <summary>
/// Gets a flag that describes device capabilities. (<see cref="CorsairDeviceCaps" />)
/// </summary>
@@ -1,4 +1,5 @@
using RGB.NET.Devices.Corsair.Native;
using System;
using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair
{
@@ -16,7 +17,9 @@ namespace RGB.NET.Devices.Corsair
/// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param>
internal CorsairHeadsetRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo)
: base(deviceIndex, Core.RGBDeviceType.Headset, nativeInfo)
{ }
{
Image = new Uri($"pack://application:,,,/RGB.NET.Devices.Corsair;component/Images/Headsets/{Model.Replace(" ", string.Empty).ToUpper()}.png", UriKind.Absolute);
}
#endregion
}
@@ -1,6 +1,7 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
using System;
using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair
@@ -36,6 +37,8 @@ namespace RGB.NET.Devices.Corsair
{
this.PhysicalLayout = (CorsairPhysicalKeyboardLayout)nativeInfo.physicalLayout;
this.LogicalLayout = (CorsairLogicalKeyboardLayout)nativeInfo.logicalLayout;
Image = new Uri($"pack://application:,,,/RGB.NET.Devices.Corsair;component/Images/Keyboards/{Model.Replace(" ", string.Empty).ToUpper()}/{LogicalLayout.ToString().ToUpper()}.png", UriKind.Absolute);
}
#endregion
@@ -1,4 +1,5 @@
using RGB.NET.Devices.Corsair.Native;
using System;
using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair
{
@@ -27,6 +28,8 @@ namespace RGB.NET.Devices.Corsair
: base(deviceIndex, Core.RGBDeviceType.Mouse, nativeInfo)
{
this.PhysicalLayout = (CorsairPhysicalMouseLayout)nativeInfo.physicalLayout;
Image = new Uri($"pack://application:,,,/RGB.NET.Devices.Corsair;component/Images/Mice/{Model.Replace(" ", string.Empty).ToUpper()}.png", UriKind.Absolute);
}
#endregion
@@ -1,4 +1,5 @@
using RGB.NET.Devices.Corsair.Native;
using System;
using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair
{
@@ -16,7 +17,9 @@ namespace RGB.NET.Devices.Corsair
/// <param name="nativeInfo">The native <see cref="_CorsairDeviceInfo" />-struct</param>
internal CorsairMousematRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo)
: base(deviceIndex, Core.RGBDeviceType.Mousemat, nativeInfo)
{ }
{
Image = new Uri($"pack://application:,,,/RGB.NET.Devices.Corsair;component/Images/Mousemat/{Model.Replace(" ", string.Empty).ToUpper()}.png", UriKind.Absolute);
}
#endregion
}
@@ -84,6 +84,12 @@
<None Include="libs\x64\CUESDK_2015.dll" />
<None Include="libs\x86\CUESDK_2015.dll" />
</ItemGroup>
<ItemGroup>
<Folder Include="Images\Headsets\" />
<Folder Include="Images\Keyboards\" />
<Folder Include="Images\Mice\" />
<Folder Include="Images\Mousemat\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.