Skip to content

Commit

Permalink
Update NuGet packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed Apr 6, 2024
1 parent d3e081c commit 05eeb57
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 60 deletions.
10 changes: 5 additions & 5 deletions LightBulb.Core.Tests/LightBulb.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="coverlet.collector" Version="6.0.2" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.27.3" PrivateAssets="all" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 2 additions & 4 deletions LightBulb.Core.Tests/LocationSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,12 @@ SolarTimes expectedSolarTimes

// Assert
solarTimes
.Sunrise
.ToTimeSpan()
.Sunrise.ToTimeSpan()
.Should()
.BeCloseTo(expectedSolarTimes.Sunrise.ToTimeSpan(), TimeSpan.FromMinutes(3));

solarTimes
.Sunset
.ToTimeSpan()
.Sunset.ToTimeSpan()
.Should()
.BeCloseTo(expectedSolarTimes.Sunset.ToTimeSpan(), TimeSpan.FromMinutes(3));
}
Expand Down
2 changes: 1 addition & 1 deletion LightBulb.Core/LightBulb.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.27.3" PrivateAssets="all" />
<PackageReference Include="JsonExtensions" Version="1.2.0" />
</ItemGroup>

Expand Down
37 changes: 16 additions & 21 deletions LightBulb.PlatformInterop/GlobalHotKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,26 @@ public partial class GlobalHotKey : NativeResource<int>
public GlobalHotKey(int id, Action callback)
: base(id)
{
_wndProcRegistration = WndProcSponge
.Default
.Listen(
0x312,
m =>
_wndProcRegistration = WndProcSponge.Default.Listen(
0x312,
m =>
{
// Filter out other hotkey events
if (m.WParam != Handle)
return;
// Throttle triggers
lock (_lock)
{
// Filter out other hotkey events
if (m.WParam != Handle)
if ((DateTimeOffset.Now - _lastTriggerTimestamp).Duration().TotalSeconds < 0.05)
return;
// Throttle triggers
lock (_lock)
{
if (
(DateTimeOffset.Now - _lastTriggerTimestamp).Duration().TotalSeconds
< 0.05
)
return;
_lastTriggerTimestamp = DateTimeOffset.Now;
}
callback();
_lastTriggerTimestamp = DateTimeOffset.Now;
}
);
callback();
}
);
}

protected override void Dispose(bool disposing)
Expand Down
2 changes: 1 addition & 1 deletion LightBulb.PlatformInterop/LightBulb.PlatformInterop.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.27.3" PrivateAssets="all" />
</ItemGroup>

</Project>
22 changes: 10 additions & 12 deletions LightBulb.PlatformInterop/PowerSettingNotification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@ namespace LightBulb.PlatformInterop;
public partial class PowerSettingNotification(nint handle, Guid powerSettingId, Action callback)
: NativeResource(handle)
{
private readonly IDisposable _wndProcRegistration = WndProcSponge
.Default
.Listen(
0x218,
m =>
{
// Filter out other power events
if (m.GetLParam<PowerBroadcastSetting>().PowerSettingId != powerSettingId)
return;
private readonly IDisposable _wndProcRegistration = WndProcSponge.Default.Listen(
0x218,
m =>
{
// Filter out other power events
if (m.GetLParam<PowerBroadcastSetting>().PowerSettingId != powerSettingId)
return;
callback();
}
);
callback();
}
);

protected override void Dispose(bool disposing)
{
Expand Down
7 changes: 4 additions & 3 deletions LightBulb.PlatformInterop/SystemEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ namespace LightBulb.PlatformInterop;

public partial class SystemEvent(int eventId, Action callback) : IDisposable
{
private readonly IDisposable _wndProcRegistration = WndProcSponge
.Default
.Listen(eventId, _ => callback());
private readonly IDisposable _wndProcRegistration = WndProcSponge.Default.Listen(
eventId,
_ => callback()
);

public void Dispose() => _wndProcRegistration.Dispose();
}
Expand Down
3 changes: 1 addition & 2 deletions LightBulb/Framework/ViewManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ public partial class ViewManager
{
var name = viewModel
.GetType()
.FullName
?.Replace("ViewModel", "View", StringComparison.Ordinal);
.FullName?.Replace("ViewModel", "View", StringComparison.Ordinal);

if (string.IsNullOrWhiteSpace(name))
return null;
Expand Down
12 changes: 6 additions & 6 deletions LightBulb/LightBulb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.9" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.6" />
<PackageReference Include="Avalonia.Diagnostics" Version="11.0.6" Condition="'$(Configuration)' == 'Debug'" />
<PackageReference Include="Avalonia" Version="11.0.10" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.10" />
<PackageReference Include="Avalonia.Diagnostics" Version="11.0.10" Condition="'$(Configuration)' == 'Debug'" />
<PackageReference Include="Cogwheel" Version="2.0.4" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="CSharpier.MsBuild" Version="0.26.5" PrivateAssets="all" />
<PackageReference Include="CSharpier.MsBuild" Version="0.27.3" PrivateAssets="all" />
<PackageReference Include="Deorcify" Version="1.0.2" PrivateAssets="all" />
<PackageReference Include="DialogHost.Avalonia" Version="0.7.7" />
<PackageReference Include="DotnetRuntimeBootstrapper" Version="2.5.1" PrivateAssets="all" Condition="$([MSBuild]::IsOsPlatform('Windows'))" />
<PackageReference Include="Material.Avalonia" Version="3.4.2" />
<PackageReference Include="DotnetRuntimeBootstrapper" Version="2.5.3" PrivateAssets="all" Condition="$([MSBuild]::IsOsPlatform('Windows'))" />
<PackageReference Include="Material.Avalonia" Version="3.5.0" />
<PackageReference Include="Material.Icons.Avalonia" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Onova" Version="2.6.10" />
Expand Down
6 changes: 3 additions & 3 deletions LightBulb/ViewModels/Components/DashboardViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ bool IsPausedByFullScreen() =>
bool IsPausedByWhitelistedApplication() =>
_settingsService.IsApplicationWhitelistEnabled
&& _settingsService.WhitelistedApplications is not null
&& _settingsService
.WhitelistedApplications
.Contains(_externalApplicationService.TryGetForegroundApplication());
&& _settingsService.WhitelistedApplications.Contains(
_externalApplicationService.TryGetForegroundApplication()
);

IsPaused = IsPausedByFullScreen() || IsPausedByWhitelistedApplication();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ private void WhitelistedApplicationsListBox_OnSelectionChanged(
SelectionChangedEventArgs args
) =>
DataContext.WhitelistedApplications = WhitelistedApplicationsListBox
.SelectedItems
?.Cast<ExternalApplication>()
.SelectedItems?.Cast<ExternalApplication>()
.ToArray();

public void Dispose() => _eventRoot.Dispose();
Expand Down

0 comments on commit 05eeb57

Please sign in to comment.