mirror of
https://github.com/Orbmu2k/nvidiaProfileInspector.git
synced 2025-12-23 23:18:07 -05:00
56 lines
1.7 KiB
C#
56 lines
1.7 KiB
C#
using nspector.Native.NVAPI2;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace nspector.Common
|
|
{
|
|
internal class CachedSettings
|
|
{
|
|
internal CachedSettings() { }
|
|
|
|
internal CachedSettings(uint settingId, NVDRS_SETTING_TYPE settingType)
|
|
{
|
|
SettingId = settingId;
|
|
SettingType = settingType;
|
|
}
|
|
|
|
internal uint SettingId;
|
|
|
|
internal List<CachedSettingValue> SettingValues = new List<CachedSettingValue>();
|
|
|
|
internal uint ProfileCount = 0;
|
|
|
|
internal NVDRS_SETTING_TYPE SettingType = NVDRS_SETTING_TYPE.NVDRS_DWORD_TYPE;
|
|
|
|
internal void AddDwordValue(uint valueDword, string Profile)
|
|
{
|
|
var setting = SettingValues.FirstOrDefault(s => s.Value == valueDword);
|
|
if (setting == null)
|
|
{
|
|
SettingValues.Add(new CachedSettingValue(valueDword, Profile));
|
|
}
|
|
else
|
|
{
|
|
setting.ProfileNames.Append(", " + Profile);
|
|
setting.ValueProfileCount++;
|
|
}
|
|
ProfileCount++;
|
|
}
|
|
|
|
internal void AddStringValue(string valueStr, string Profile)
|
|
{
|
|
|
|
var setting = SettingValues.FirstOrDefault(s => s.ValueStr == valueStr);
|
|
if (setting == null)
|
|
{
|
|
SettingValues.Add(new CachedSettingValue(valueStr, Profile));
|
|
}
|
|
else
|
|
{
|
|
setting.ProfileNames.Append(", " + Profile);
|
|
setting.ValueProfileCount++;
|
|
}
|
|
ProfileCount++;
|
|
}
|
|
}
|
|
} |