From 705c0c99d1e6720faafab58810ec91311975dddd Mon Sep 17 00:00:00 2001 From: emoacht Date: Sat, 4 Jun 2022 18:03:46 +0900 Subject: [PATCH 1/3] Add refresh rate --- Source/Monitorian.Core/Models/Monitor/DisplayConfig.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Monitorian.Core/Models/Monitor/DisplayConfig.cs b/Source/Monitorian.Core/Models/Monitor/DisplayConfig.cs index 42070df8..74a66288 100644 --- a/Source/Monitorian.Core/Models/Monitor/DisplayConfig.cs +++ b/Source/Monitorian.Core/Models/Monitor/DisplayConfig.cs @@ -274,21 +274,26 @@ public class DisplayItem : IDisplayItem public bool IsInternal { get; } [DataMember(Order = 3)] - public string ConnectionDescription { get; } + public float RefreshRate { get; } [DataMember(Order = 4)] + public string ConnectionDescription { get; } + + [DataMember(Order = 5)] public bool IsAvailable { get; } public DisplayItem( string deviceInstanceId, string displayName, bool isInternal, + float refreshRate, string connectionDescription, bool isAvailable) { this.DeviceInstanceId = deviceInstanceId; this.DisplayName = displayName; this.IsInternal = isInternal; + this.RefreshRate = refreshRate; this.ConnectionDescription = connectionDescription; this.IsAvailable = isAvailable; } @@ -339,6 +344,7 @@ public static IEnumerable EnumerateDisplayConfigs() deviceInstanceId: deviceInstanceId, displayName: deviceName.monitorFriendlyDeviceName, isInternal: (deviceName.outputTechnology == DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY.DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL), + refreshRate: displayPath.targetInfo.refreshRate.Numerator / (float)displayPath.targetInfo.refreshRate.Denominator, connectionDescription: GetConnectionDescription(deviceName.outputTechnology), isAvailable: displayPath.targetInfo.targetAvailable); } From 11ad140c0584952571a180a168d4b7c1054b737c Mon Sep 17 00:00:00 2001 From: emoacht Date: Sat, 4 Jun 2022 18:11:33 +0900 Subject: [PATCH 2/3] Move OS version to system information --- .../Models/Monitor/MonitorManager.cs | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Source/Monitorian.Core/Models/Monitor/MonitorManager.cs b/Source/Monitorian.Core/Models/Monitor/MonitorManager.cs index a9e5a866..b6e0a48e 100644 --- a/Source/Monitorian.Core/Models/Monitor/MonitorManager.cs +++ b/Source/Monitorian.Core/Models/Monitor/MonitorManager.cs @@ -293,31 +293,28 @@ private class MonitorData [DataMember(Order = 0)] public string System { get; private set; } - [DataMember(Order = 1)] - public string OS { get; private set; } - // When Name property of DataMemberAttribute contains a space or specific character // (e.g. !, ?), DataContractJsonSerializer.WriteObject method will internally throw // a System.Xml.XmlException while it will work fine. - [DataMember(Order = 2, Name = "Device Context - DeviceItems")] + [DataMember(Order = 1, Name = "Device Context - DeviceItems")] public DeviceContext.DeviceItem[] DeviceItems { get; private set; } - [DataMember(Order = 3, Name = "DisplayMonitor - DisplayItems")] + [DataMember(Order = 2, Name = "DisplayMonitor - DisplayItems")] public DisplayMonitor.DisplayItem[] DisplayMonitorItems { get; private set; } - [DataMember(Order = 4, Name = "Display Config - DisplayItems")] + [DataMember(Order = 3, Name = "Display Config - DisplayItems")] public DisplayConfig.DisplayItem[] DisplayConfigItems { get; private set; } - [DataMember(Order = 5, Name = "Device Installation - InstalledItems")] + [DataMember(Order = 4, Name = "Device Installation - InstalledItems")] public DeviceInformation.InstalledItem[] InstalledItems { get; private set; } - [DataMember(Order = 6, Name = "Monitor Configuration - PhysicalItems")] + [DataMember(Order = 5, Name = "Monitor Configuration - PhysicalItems")] public Dictionary PhysicalItems { get; private set; } - [DataMember(Order = 7, Name = "MSMonitorClass - DesktopItems")] + [DataMember(Order = 6, Name = "MSMonitorClass - DesktopItems")] public MSMonitor.DesktopItem[] DesktopItems { get; private set; } - [DataMember(Order = 8)] + [DataMember(Order = 7)] public string[] ElapsedTime { get; private set; } public MonitorData() @@ -326,7 +323,6 @@ public MonitorData() public async Task PopulateAsync() { System = GetSystem(); - OS = Environment.OSVersion.Version.ToString(); var sw = new Stopwatch(); @@ -377,7 +373,7 @@ private string GetSystem() { using var @class = new ManagementClass("Win32_ComputerSystem"); using var instance = @class.GetInstances().Cast().FirstOrDefault(); - return $"Manufacturer: {instance?["Manufacturer"]}, Model: {instance?["Model"]}"; + return $"Manufacturer: {instance?["Manufacturer"]}, Model: {instance?["Model"]}, OS: {Environment.OSVersion.Version}"; } } From 2f3ca7b19a84c70931758eaeda2e3973eefca69e Mon Sep 17 00:00:00 2001 From: emoacht Date: Sat, 4 Jun 2022 18:12:54 +0900 Subject: [PATCH 3/3] Increment build number --- Source/Installer/Product.wxs | 2 +- Source/Monitorian.Core/Properties/AssemblyInfo.cs | 4 ++-- Source/Monitorian/Properties/AssemblyInfo.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Installer/Product.wxs b/Source/Installer/Product.wxs index 545ccdbd..3e5a794b 100644 --- a/Source/Installer/Product.wxs +++ b/Source/Installer/Product.wxs @@ -1,6 +1,6 @@  -