Updated Layouts to contain device-image infos

This commit is contained in:
DarthAffe committed 2018-01-17 21:56:01 +01:00
1 parent 6fe54bd3ec
commit 739fbf8733
64 files changed
+143 -185

No files matched your search

@@ -56,10 +56,9 @@ namespace RGB.NET.Devices.Logitech
protected virtual void InitializeLayout()
{
if (!(DeviceInfo is LogitechRGBDeviceInfo info)) return;
string basePath = info.ImageBasePath;
string layout = info.ImageLayout;
string layoutPath = info.LayoutPath;
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Logitech\{layoutPath}.xml"), layout, PathHelper.GetAbsolutePath($@"Images\Logitech\{basePath}"), true);
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Logitech\{layoutPath}.xml"), layout, true);
}
#endregion
@@ -21,7 +21,7 @@ namespace RGB.NET.Devices.Logitech
public string Model { get; }
/// <inheritdoc />
public Uri Image { get; protected set; }
public Uri Image { get; set; }
/// <inheritdoc />
public RGBDeviceLighting Lighting
@@ -46,11 +46,6 @@ namespace RGB.NET.Devices.Logitech
/// </summary>
public LogitechDeviceCaps DeviceCaps { get; }
/// <summary>
/// Gets the base of the image path used to load device-images.
/// </summary>
internal string ImageBasePath { get; }
/// <summary>
/// Gets the layout used to decide which images to load.
/// </summary>
@@ -74,17 +69,14 @@ namespace RGB.NET.Devices.Logitech
/// <param name="imageBasePath">The base of the image path used to load device-images.</param>
/// <param name="imageLayout">The layout used to decide which images to load.</param>
/// <param name="layoutPath">The path/name of the layout-file.</param>
internal LogitechRGBDeviceInfo(RGBDeviceType deviceType, string model, LogitechDeviceCaps deviceCaps,
string imageBasePath, string imageLayout, string layoutPath)
internal LogitechRGBDeviceInfo(RGBDeviceType deviceType, string model, LogitechDeviceCaps deviceCaps,
string imageLayout, string layoutPath)
{
this.DeviceType = deviceType;
this.Model = model;
this.DeviceCaps = deviceCaps;
this.ImageBasePath = imageBasePath;
this.ImageLayout = imageLayout;
this.LayoutPath = layoutPath;
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Logitech\{LayoutPath}.png"), UriKind.Absolute);
}
#endregion