mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 13:06:24 +00:00
Refactoring
This commit is contained in:
1 parent
7264731eb1
commit
59e0344c68
32 files changed
+82
-176
No files matched your search
@@ -1,44 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <summary>
|
||||
/// Offers some helper-methods for culture related things.
|
||||
/// </summary>
|
||||
internal static class CultureHelper
|
||||
{
|
||||
#region DLLImports
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern IntPtr GetKeyboardLayout(uint thread);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current keyboard-layout from the OS.
|
||||
/// </summary>
|
||||
/// <returns>The current keyboard-layout</returns>
|
||||
internal static CultureInfo GetCurrentCulture()
|
||||
{
|
||||
try
|
||||
{
|
||||
int keyboardLayout = GetKeyboardLayout(0).ToInt32() & 0xFFFF;
|
||||
return new CultureInfo(keyboardLayout);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new CultureInfo(1033); // en-US on error.
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
/// <summary>
|
||||
/// Offers some helper-methods for file-path related things.
|
||||
/// </summary>
|
||||
internal static class PathHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns an absolute path created from an relative path relatvie to the location of the executung assembly.
|
||||
/// </summary>
|
||||
/// <param name="relativePath">The relative path to convert.</param>
|
||||
/// <returns>The absolute path.</returns>
|
||||
internal static string GetAbsolutePath(string relativePath)
|
||||
{
|
||||
string assemblyLocation = Assembly.GetEntryAssembly()?.Location;
|
||||
if (assemblyLocation == null) return relativePath;
|
||||
|
||||
return Path.Combine(Path.GetDirectoryName(assemblyLocation), relativePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Logitech
|
||||
{
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("RGB.NET.Devices.Logitech")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyDescription("Logitech-Device-Implementations of RGB.NET")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyCompany("Wyrez")]
|
||||
[assembly: AssemblyProduct("RGB.NET.Devices.Logitech")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyCopyright("Copyright © Wyrez 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
||||
@@ -58,8 +58,6 @@
|
||||
<Compile Include="Generic\LogitechRGBDevice.cs" />
|
||||
<Compile Include="Generic\LogitechRGBDeviceInfo.cs" />
|
||||
<Compile Include="Helper\BitmapMapping.cs" />
|
||||
<Compile Include="Helper\CultureHelper.cs" />
|
||||
<Compile Include="Helper\PathHelper.cs" />
|
||||
<Compile Include="HID\DeviceChecker.cs" />
|
||||
<Compile Include="Keyboard\LogitechKeyboardRGBDevice.cs" />
|
||||
<Compile Include="Keyboard\LogitechKeyboardRGBDeviceInfo.cs" />
|
||||
|
||||
Reference in new issue
Block a user