Skip to content

Commit

Permalink
Merge pull request #333 from emoacht/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
emoacht authored Jun 4, 2022
2 parents 4fa3ec8 + 2f3ca7b commit c3e1ac2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Source/Installer/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Monitorian" Manufacturer="emoacht" Version="3.11.2"
<Product Id="*" Name="Monitorian" Manufacturer="emoacht" Version="3.11.3"
Language="1033" Codepage="1252" UpgradeCode="{81A4D148-75D3-462E-938D-8C208FB48E3C}">
<Package Id="*" InstallerVersion="500" Compressed="yes"
InstallScope="perMachine" InstallPrivileges="elevated"
Expand Down
8 changes: 7 additions & 1 deletion Source/Monitorian.Core/Models/Monitor/DisplayConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -339,6 +344,7 @@ public static IEnumerable<DisplayItem> 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);
}
Expand Down
20 changes: 8 additions & 12 deletions Source/Monitorian.Core/Models/Monitor/MonitorManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DeviceContext.HandleItem, PhysicalItemPlus[]> 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()
Expand All @@ -326,7 +323,6 @@ public MonitorData()
public async Task PopulateAsync()
{
System = GetSystem();
OS = Environment.OSVersion.Version.ToString();

var sw = new Stopwatch();

Expand Down Expand Up @@ -377,7 +373,7 @@ private string GetSystem()
{
using var @class = new ManagementClass("Win32_ComputerSystem");
using var instance = @class.GetInstances().Cast<ManagementObject>().FirstOrDefault();
return $"Manufacturer: {instance?["Manufacturer"]}, Model: {instance?["Model"]}";
return $"Manufacturer: {instance?["Manufacturer"]}, Model: {instance?["Model"]}, OS: {Environment.OSVersion.Version}";
}
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Monitorian.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.11.2.0")]
[assembly: AssemblyFileVersion("3.11.2.0")]
[assembly: AssemblyVersion("3.11.3.0")]
[assembly: AssemblyFileVersion("3.11.3.0")]
[assembly: NeutralResourcesLanguage("en-US")]

// For unit test
Expand Down
4 changes: 2 additions & 2 deletions Source/Monitorian/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.11.2.0")]
[assembly: AssemblyFileVersion("3.11.2.0")]
[assembly: AssemblyVersion("3.11.3.0")]
[assembly: AssemblyFileVersion("3.11.3.0")]
[assembly: Guid("a4cc5362-9b08-465b-ad64-5cfabc72a4c7")]
[assembly: NeutralResourcesLanguage("en-US")]

0 comments on commit c3e1ac2

Please sign in to comment.