Skip to content

Commit d43f574

Browse files
authored
Merge pull request #506 from emoacht/develop
Develop
2 parents 8eba27a + a339417 commit d43f574

File tree

4 files changed

+10
-53
lines changed

4 files changed

+10
-53
lines changed

Source/Installer/Product.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3-
<Product Id="*" Name="Monitorian" Manufacturer="emoacht" Version="4.4.11"
3+
<Product Id="*" Name="Monitorian" Manufacturer="emoacht" Version="4.4.12"
44
Language="1033" Codepage="1252" UpgradeCode="{81A4D148-75D3-462E-938D-8C208FB48E3C}">
55
<Package Id="*" InstallerVersion="500" Compressed="yes"
66
InstallScope="perMachine" InstallPrivileges="elevated"

Source/Monitorian.Core/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
// You can specify all the values or you can default the Build and Revision Numbers
3434
// by using the '*' as shown below:
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("4.4.11.0")]
37-
[assembly: AssemblyFileVersion("4.4.11.0")]
36+
[assembly: AssemblyVersion("4.4.12.0")]
37+
[assembly: AssemblyFileVersion("4.4.12.0")]
3838
[assembly: NeutralResourcesLanguage("en-US")]
3939

4040
// For unit test

Source/Monitorian.Core/Views/UISettings.cs

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ namespace Monitorian.Core.Views
1616
/// </remarks>
1717
public static class UISettings
1818
{
19-
private static Windows.UI.ViewManagement.UISettings _uiSettings;
19+
// UISettings.ColorValuesChanged is not supported in desktop apps.
20+
// https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/desktop-to-uwp-supported-api#unsupported-members
2021

2122
/// <summary>
2223
/// Gets the system accent color.
@@ -42,56 +43,12 @@ public static class UISettings
4243
/// <returns></returns>
4344
public static Color GetBackgroundColor() => GetUIColor(Windows.UI.ViewManagement.UIColorType.Background);
4445

46+
private static Windows.UI.ViewManagement.UISettings _uiSettings;
47+
4548
private static Color GetUIColor(Windows.UI.ViewManagement.UIColorType colorType)
4649
{
47-
var value = (_uiSettings ?? new Windows.UI.ViewManagement.UISettings()).GetColorValue(colorType);
50+
var value = (_uiSettings ??= new Windows.UI.ViewManagement.UISettings()).GetColorValue(colorType);
4851
return Color.FromArgb(value.A, value.R, value.G, value.B);
4952
}
50-
51-
private static readonly object _lock = new();
52-
53-
/// <summary>
54-
/// Occurs when colors have changed.
55-
/// </summary>
56-
/// <remarks>
57-
/// UISettings.ColorValuesChanged event seems not to fire when this assembly is packaged.
58-
/// </remarks>
59-
public static event EventHandler ColorsChanged
60-
{
61-
add
62-
{
63-
lock (_lock)
64-
{
65-
_colorsChanged += value;
66-
67-
if (_uiSettings is null)
68-
{
69-
_uiSettings = new Windows.UI.ViewManagement.UISettings();
70-
_uiSettings.ColorValuesChanged += OnColorValuesChanged;
71-
}
72-
}
73-
}
74-
remove
75-
{
76-
lock (_lock)
77-
{
78-
_colorsChanged -= value;
79-
if (_colorsChanged is not null)
80-
return;
81-
82-
if (_uiSettings is not null)
83-
{
84-
_uiSettings.ColorValuesChanged -= OnColorValuesChanged;
85-
_uiSettings = null;
86-
}
87-
}
88-
}
89-
}
90-
private static event EventHandler _colorsChanged;
91-
92-
private static void OnColorValuesChanged(Windows.UI.ViewManagement.UISettings sender, object args)
93-
{
94-
_colorsChanged?.Invoke(sender, EventArgs.Empty);
95-
}
9653
}
9754
}

Source/Monitorian/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("4.4.11.0")]
55-
[assembly: AssemblyFileVersion("4.4.11.0")]
54+
[assembly: AssemblyVersion("4.4.12.0")]
55+
[assembly: AssemblyFileVersion("4.4.12.0")]
5656
[assembly: Guid("a4cc5362-9b08-465b-ad64-5cfabc72a4c7")]
5757
[assembly: NeutralResourcesLanguage("en-US")]

0 commit comments

Comments
 (0)