1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-12 09:38:31 +00:00
Darth Affe 284c551be6 Changed projects to built against .net standard (and .net 4.5).
This resolves #14.
Resources like SDK-libs, Images and Layouts are removed (and put into an own repository) in that process.
2018-04-01 21:54:14 +02:00

47 lines
1.2 KiB
C#

#if NETFULL
using System.Management;
namespace RGB.NET.Devices.Asus
{
// ReSharper disable once InconsistentNaming
internal static class WMIHelper
{
#region Properties & Fields
private static ManagementObjectSearcher _mainboardSearcher = new ManagementObjectSearcher(@"root\CIMV2", "SELECT * FROM Win32_BaseBoard");
private static (string manufacturer, string model)? _mainboardInfo;
#endregion
#region Methods
internal static (string manufacturer, string model)? GetMainboardInfo()
{
if (!_mainboardInfo.HasValue)
foreach (ManagementBaseObject managementBaseObject in _mainboardSearcher.Get())
{
_mainboardInfo = (managementBaseObject["Manufacturer"]?.ToString(), managementBaseObject["Product"]?.ToString());
break;
}
return _mainboardInfo;
}
#endregion
}
}
#else
namespace RGB.NET.Devices.Asus
{
// ReSharper disable once InconsistentNaming
internal static class WMIHelper
{
#region Methods
internal static (string manufacturer, string model)? GetMainboardInfo() => null;
#endregion
}
}
#endif