Skip to content

Commit

Permalink
Merge pull request #387 from emoacht/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
emoacht authored Dec 15, 2022
2 parents eca288a + e946a5c commit d9730e2
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 11 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.15.2"
<Product Id="*" Name="Monitorian" Manufacturer="emoacht" Version="3.15.3"
Language="1033" Codepage="1252" UpgradeCode="{81A4D148-75D3-462E-938D-8C208FB48E3C}">
<Package Id="*" InstallerVersion="500" Compressed="yes"
InstallScope="perMachine" InstallPrivileges="elevated"
Expand Down
9 changes: 7 additions & 2 deletions Source/Monitorian.Core/AppControllerCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,16 @@ protected virtual async void OnSettingsChanged(object sender, PropertyChangedEve

#region Monitors

protected virtual async void OnMonitorsChangeInferred(object sender = null, ICountEventArgs e = null)
protected virtual async void OnMonitorsChangeInferred(object sender, ICountEventArgs e = null)
{
await Recorder.RecordAsync($"{nameof(OnMonitorsChangeInferred)} ({sender}{e?.Description})");

if (e?.Count == 0)
await ProceedScanAsync(e);
}

protected virtual async Task ProceedScanAsync(ICountEventArgs e)
{
if (e is { Count: 0 })
return;

await ScanAsync(TimeSpan.FromSeconds(3));
Expand Down
2 changes: 1 addition & 1 deletion Source/Monitorian.Core/Models/Watcher/DisplayWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal class DisplayWatcher : TimerWatcher
{
private Action<ICountEventArgs> _onDisplaySettingsChanged;

public DisplayWatcher() : base(1, 4, 5)
public DisplayWatcher() : base(1, 4, 5, 10)
{ }

public void Subscribe(Action<ICountEventArgs> onDisplaySettingsChanged)
Expand Down
3 changes: 2 additions & 1 deletion Source/Monitorian.Core/Models/Watcher/PowerWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ private void OnDisplayStateChanged(DisplayStates state)
{
switch (state)
{
case DisplayStates.On or DisplayStates.Dimmed:
case DisplayStates.On:
case DisplayStates.Dimmed:
RaiseDisplayStateChanged(state, 0);
_stateWatcher.TimerStart(state);
break;
Expand Down
2 changes: 1 addition & 1 deletion Source/Monitorian.Core/Models/Watcher/TimerWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal abstract class TimerWatcher : IDisposable
/// <param name="intervals">Sequence of timer intervals in seconds</param>
protected TimerWatcher(params int[] intervals)
{
if (intervals?.Length is not > 0)
if (intervals is not { Length: > 0 })
throw new ArgumentNullException(nameof(intervals));
if (intervals.Any(x => x <= 0))
throw new ArgumentOutOfRangeException(nameof(intervals), intervals.First(x => x <= 0), "An interval must be positive.");
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.15.2.0")]
[assembly: AssemblyFileVersion("3.15.2.0")]
[assembly: AssemblyVersion("3.15.3.0")]
[assembly: AssemblyFileVersion("3.15.3.0")]
[assembly: NeutralResourcesLanguage("en-US")]

// For unit test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref b
{
case TouchpadHelper.WM_INPUT:
var contacts = TouchpadHelper.ParseInput(lParam);
if (contacts?.Length > 1)
if (contacts is { Length: > 1 })
{
Check(contacts[0]);
handled = true;
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.15.2.0")]
[assembly: AssemblyFileVersion("3.15.2.0")]
[assembly: AssemblyVersion("3.15.3.0")]
[assembly: AssemblyFileVersion("3.15.3.0")]
[assembly: Guid("a4cc5362-9b08-465b-ad64-5cfabc72a4c7")]
[assembly: NeutralResourcesLanguage("en-US")]

0 comments on commit d9730e2

Please sign in to comment.