From ece0250c1ebce7dfa3cda8c95e341cb096ad95cd Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Mon, 2 Sep 2024 03:16:15 +0300 Subject: [PATCH] Fix formatting --- LightBulb.Core.Tests/LocationSpecs.cs | 4 ++-- LightBulb.Core/CycleState.cs | 2 +- LightBulb.Core/Utils/Http.cs | 6 +++--- LightBulb.PlatformInterop/DeviceContext.cs | 2 +- LightBulb.PlatformInterop/Internal/WndProcSponge.cs | 2 +- .../Utils/Extensions/RegistryExtensions.cs | 2 +- LightBulb.PlatformInterop/Utils/Reg.cs | 7 +++---- LightBulb/App.axaml.cs | 4 ++-- .../Converters/CycleStateToMaterialIconKindConverter.cs | 3 ++- .../Converters/SettingsTabToMaterialIconKindConverter.cs | 3 ++- LightBulb/Framework/ThemeVariant.cs | 2 +- LightBulb/Framework/ViewManager.cs | 2 +- LightBulb/StartOptions.cs | 2 +- LightBulb/ViewModels/Components/DashboardViewModel.cs | 9 ++++----- 14 files changed, 25 insertions(+), 25 deletions(-) diff --git a/LightBulb.Core.Tests/LocationSpecs.cs b/LightBulb.Core.Tests/LocationSpecs.cs index aabb246b..7e2479bc 100644 --- a/LightBulb.Core.Tests/LocationSpecs.cs +++ b/LightBulb.Core.Tests/LocationSpecs.cs @@ -39,7 +39,7 @@ public class LocationSpecs new GeoLocation(69.6489, 18.9551), new DateTimeOffset(2020, 01, 03, 00, 00, 00, TimeSpan.FromHours(+1)), new SolarTimes(new TimeOnly(11, 48), new TimeOnly(11, 48)) - } + }, }; [Theory] @@ -91,7 +91,7 @@ SolarTimes expectedSolarTimes { "-41.25 S, 120.9762 E", null }, { "41.25", null }, { "", null }, - { null, null } + { null, null }, }; [Theory] diff --git a/LightBulb.Core/CycleState.cs b/LightBulb.Core/CycleState.cs index 05cd3d41..0fbbfdba 100644 --- a/LightBulb.Core/CycleState.cs +++ b/LightBulb.Core/CycleState.cs @@ -6,5 +6,5 @@ public enum CycleState Paused, Day, Night, - Transition + Transition, } diff --git a/LightBulb.Core/Utils/Http.cs b/LightBulb.Core/Utils/Http.cs index 4380e002..a4d0e410 100644 --- a/LightBulb.Core/Utils/Http.cs +++ b/LightBulb.Core/Utils/Http.cs @@ -17,8 +17,8 @@ public static class Http new ProductInfoHeaderValue( "LightBulb", Assembly.GetExecutingAssembly().GetName().Version?.ToString() - ) - } - } + ), + }, + }, }; } diff --git a/LightBulb.PlatformInterop/DeviceContext.cs b/LightBulb.PlatformInterop/DeviceContext.cs index 48db2ebd..2a460b94 100644 --- a/LightBulb.PlatformInterop/DeviceContext.cs +++ b/LightBulb.PlatformInterop/DeviceContext.cs @@ -19,7 +19,7 @@ public void SetGamma(double redMultiplier, double greenMultiplier, double blueMu { Red = new ushort[256], Green = new ushort[256], - Blue = new ushort[256] + Blue = new ushort[256], }; // Create linear ramps for each color diff --git a/LightBulb.PlatformInterop/Internal/WndProcSponge.cs b/LightBulb.PlatformInterop/Internal/WndProcSponge.cs index b5bd37eb..2b8e38cd 100644 --- a/LightBulb.PlatformInterop/Internal/WndProcSponge.cs +++ b/LightBulb.PlatformInterop/Internal/WndProcSponge.cs @@ -71,7 +71,7 @@ internal partial class WndProcSponge { ClassName = ClassName, WndProc = wndProc, - Instance = NativeModule.CurrentHandle + Instance = NativeModule.CurrentHandle, }; var classHandle = NativeMethods.RegisterClassEx(ref classInfo); diff --git a/LightBulb.PlatformInterop/Utils/Extensions/RegistryExtensions.cs b/LightBulb.PlatformInterop/Utils/Extensions/RegistryExtensions.cs index 427e6e48..fe71dad9 100644 --- a/LightBulb.PlatformInterop/Utils/Extensions/RegistryExtensions.cs +++ b/LightBulb.PlatformInterop/Utils/Extensions/RegistryExtensions.cs @@ -19,6 +19,6 @@ public static string GetShortMoniker(this RegistryHive hive) => RegistryHive.Users => "HKU", RegistryHive.PerformanceData => "HKPD", RegistryHive.CurrentConfig => "HKCC", - _ => throw new ArgumentOutOfRangeException(nameof(hive)) + _ => throw new ArgumentOutOfRangeException(nameof(hive)), }; } diff --git a/LightBulb.PlatformInterop/Utils/Reg.cs b/LightBulb.PlatformInterop/Utils/Reg.cs index 35004aa4..56be0c03 100644 --- a/LightBulb.PlatformInterop/Utils/Reg.cs +++ b/LightBulb.PlatformInterop/Utils/Reg.cs @@ -42,10 +42,9 @@ public static void SetValue(string key, string entry, T value) null => "REG_NONE", int => "REG_DWORD", string => "REG_SZ", - _ - => throw new NotSupportedException( - $"Unsupported registry value type '{value.GetType()}'." - ) + _ => throw new NotSupportedException( + $"Unsupported registry value type '{value.GetType()}'." + ), }; Run(["add", key, "/v", entry, "/d", value?.ToString() ?? "", "/t", entryType, "/f"], true); diff --git a/LightBulb/App.axaml.cs b/LightBulb/App.axaml.cs index 144e55d7..d03f34dd 100644 --- a/LightBulb/App.axaml.cs +++ b/LightBulb/App.axaml.cs @@ -70,7 +70,7 @@ public App() { ThemeVariant.Light => Avalonia.Styling.ThemeVariant.Light, ThemeVariant.Dark => Avalonia.Styling.ThemeVariant.Dark, - _ => Avalonia.Styling.ThemeVariant.Default + _ => Avalonia.Styling.ThemeVariant.Default, }; InitializeTheme(); @@ -122,7 +122,7 @@ private void InitializeTheme() { "Light" => PlatformThemeVariant.Light, "Dark" => PlatformThemeVariant.Dark, - _ => PlatformSettings?.GetColorValues().ThemeVariant ?? PlatformThemeVariant.Light + _ => PlatformSettings?.GetColorValues().ThemeVariant ?? PlatformThemeVariant.Light, }; this.LocateMaterialTheme().CurrentTheme = diff --git a/LightBulb/Converters/CycleStateToMaterialIconKindConverter.cs b/LightBulb/Converters/CycleStateToMaterialIconKindConverter.cs index 32d4caed..1ec44835 100644 --- a/LightBulb/Converters/CycleStateToMaterialIconKindConverter.cs +++ b/LightBulb/Converters/CycleStateToMaterialIconKindConverter.cs @@ -18,7 +18,8 @@ public object Convert(object? value, Type targetType, object? parameter, Culture CycleState.Day => MaterialIconKind.WhiteBalanceSunny, CycleState.Night => MaterialIconKind.MoonAndStars, CycleState.Transition => MaterialIconKind.Sync, - _ => MaterialIconKind.QuestionMark // shouldn't happen + // Shouldn't happen + _ => MaterialIconKind.QuestionMark, }; public object ConvertBack( diff --git a/LightBulb/Converters/SettingsTabToMaterialIconKindConverter.cs b/LightBulb/Converters/SettingsTabToMaterialIconKindConverter.cs index 02fbdb9a..76b766ac 100644 --- a/LightBulb/Converters/SettingsTabToMaterialIconKindConverter.cs +++ b/LightBulb/Converters/SettingsTabToMaterialIconKindConverter.cs @@ -18,7 +18,8 @@ public object Convert(object? value, Type targetType, object? parameter, Culture AdvancedSettingsTabViewModel => MaterialIconKind.CheckboxesMarked, ApplicationWhitelistSettingsTabViewModel => MaterialIconKind.Apps, HotKeySettingsTabViewModel => MaterialIconKind.Keyboard, - _ => MaterialIconKind.QuestionMark // shouldn't happen + // Shouldn't happen + _ => MaterialIconKind.QuestionMark, }; public object ConvertBack( diff --git a/LightBulb/Framework/ThemeVariant.cs b/LightBulb/Framework/ThemeVariant.cs index 4a062ad7..8b81f3a7 100644 --- a/LightBulb/Framework/ThemeVariant.cs +++ b/LightBulb/Framework/ThemeVariant.cs @@ -4,5 +4,5 @@ public enum ThemeVariant { System, Light, - Dark + Dark, } diff --git a/LightBulb/Framework/ViewManager.cs b/LightBulb/Framework/ViewManager.cs index 2ab15864..75b5834f 100644 --- a/LightBulb/Framework/ViewManager.cs +++ b/LightBulb/Framework/ViewManager.cs @@ -25,7 +25,7 @@ public partial class ViewManager GeneralSettingsTabViewModel => new GeneralSettingsTabView(), HotKeySettingsTabViewModel => new HotKeySettingsTabView(), LocationSettingsTabViewModel => new LocationSettingsTabView(), - _ => null + _ => null, }; public Control? TryBindView(ViewModelBase viewModel) diff --git a/LightBulb/StartOptions.cs b/LightBulb/StartOptions.cs index cc29fa6e..41d78a7a 100644 --- a/LightBulb/StartOptions.cs +++ b/LightBulb/StartOptions.cs @@ -22,6 +22,6 @@ public static StartOptions Parse(IReadOnlyList commandLineArgs) => IsInitiallyHidden = commandLineArgs.Contains( IsInitiallyHiddenArgument, StringComparer.OrdinalIgnoreCase - ) + ), }; } diff --git a/LightBulb/ViewModels/Components/DashboardViewModel.cs b/LightBulb/ViewModels/Components/DashboardViewModel.cs index 37f148d9..321e778c 100644 --- a/LightBulb/ViewModels/Components/DashboardViewModel.cs +++ b/LightBulb/ViewModels/Components/DashboardViewModel.cs @@ -107,7 +107,7 @@ ExternalApplicationService externalApplicationService o => o.DecreaseTemperatureOffsetHotKey, o => o.IncreaseBrightnessOffsetHotKey, o => o.DecreaseBrightnessOffsetHotKey, - o => o.ResetConfigurationOffsetHotKey + o => o.ResetConfigurationOffsetHotKey, ], RegisterHotKeys ) @@ -173,9 +173,8 @@ ExternalApplicationService externalApplicationService _settingsService.MinimumBrightness, _settingsService.MaximumBrightness ) - : _settingsService.IsDefaultToDayConfigurationEnabled - ? _settingsService.DayConfiguration - : ColorConfiguration.Default; + : _settingsService.IsDefaultToDayConfigurationEnabled ? _settingsService.DayConfiguration + : ColorConfiguration.Default; public ColorConfiguration AdjustedDayConfiguration => _settingsService.DayConfiguration.WithOffset(TemperatureOffset, BrightnessOffset); @@ -191,7 +190,7 @@ ExternalApplicationService externalApplicationService _ when IsPaused => CycleState.Paused, _ when CurrentConfiguration == AdjustedDayConfiguration => CycleState.Day, _ when CurrentConfiguration == AdjustedNightConfiguration => CycleState.Night, - _ => CycleState.Transition + _ => CycleState.Transition, }; private void RegisterHotKeys()