diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/BasePTModuleSettings.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/BasePTModuleSettings.cs index 2b3806d7b9..2a3b7b843e 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/BasePTModuleSettings.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/BasePTModuleSettings.cs @@ -3,16 +3,19 @@ // See the LICENSE file in the project root for more information. using System.Text.Json; +using System.Text.Json.Serialization; namespace Microsoft.PowerToys.Settings.UI.Lib { public abstract class BasePTModuleSettings { // Gets or sets name of the powertoy module. - public string name { get; set; } + [JsonPropertyName("name")] + public string Name { get; set; } // Gets or sets the powertoys version. - public string version { get; set; } + [JsonPropertyName("version")] + public string Version { get; set; } // converts the current to a json string. public virtual string ToJsonString() diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ColorPickerSettings.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ColorPickerSettings.cs index f5861a01ea..382f6927fa 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ColorPickerSettings.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ColorPickerSettings.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Text.Json; +using System.Text.Json.Serialization; namespace Microsoft.PowerToys.Settings.UI.Lib { @@ -10,18 +11,14 @@ namespace Microsoft.PowerToys.Settings.UI.Lib { public const string ModuleName = "ColorPicker"; - public ColorPickerProperties properties { get; set; } + [JsonPropertyName("properties")] + public ColorPickerProperties Properties { get; set; } public ColorPickerSettings() { - properties = new ColorPickerProperties(); - version = "1"; - name = ModuleName; - } - - public override string ToJsonString() - { - return JsonSerializer.Serialize(this); + Properties = new ColorPickerProperties(); + Version = "1"; + Name = ModuleName; } public virtual void Save() diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/FZConfigProperties.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/FZConfigProperties.cs index 63be5ac590..0300a06b7e 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/FZConfigProperties.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/FZConfigProperties.cs @@ -23,7 +23,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib this.FancyzonesShowOnAllMonitors = new BoolProperty(); this.FancyzonesZoneHighlightColor = new StringProperty(ConfigDefaults.DefaultFancyZonesZoneHighlightColor); this.FancyzonesHighlightOpacity = new IntProperty(50); - this.FancyzonesEditorHotkey = new KeyBoardKeysProperty( + this.FancyzonesEditorHotkey = new KeyboardKeysProperty( new HotkeySettings() { Win = true, @@ -82,7 +82,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib public IntProperty FancyzonesHighlightOpacity { get; set; } [JsonPropertyName("fancyzones_editor_hotkey")] - public KeyBoardKeysProperty FancyzonesEditorHotkey { get; set; } + public KeyboardKeysProperty FancyzonesEditorHotkey { get; set; } [JsonPropertyName("fancyzones_excluded_apps")] public StringProperty FancyzonesExcludedApps { get; set; } diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/FancyZonesSettings.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/FancyZonesSettings.cs index 8969a9336b..e3e49aa9f9 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/FancyZonesSettings.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/FancyZonesSettings.cs @@ -2,35 +2,20 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; using System.Text.Json.Serialization; namespace Microsoft.PowerToys.Settings.UI.Lib { - public class FancyZonesSettings + public class FancyZonesSettings : BasePTModuleSettings { public FancyZonesSettings() { - this.Version = string.Empty; - this.Name = string.Empty; - this.Properties = new FZConfigProperties(); + Version = string.Empty; + Name = string.Empty; + Properties = new FZConfigProperties(); } - [JsonPropertyName("version")] - public string Version { get; set; } - - [JsonPropertyName("name")] - public string Name { get; set; } - [JsonPropertyName("properties")] public FZConfigProperties Properties { get; set; } - - public string ToJsonString() - { - return JsonSerializer.Serialize(this); - } } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/IPowerToySettings.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/IPowerToySettings.cs deleted file mode 100644 index 727656c0cc..0000000000 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/IPowerToySettings.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation -// The Microsoft Corporation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Generic; -using System.Text; - -namespace Microsoft.PowerToys.Settings.UI.Lib -{ - public interface IPowerToySettings - { - string name { get; set; } - - string version { get; set; } - - string ToJsonString(); - } -} diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageResizerProperties.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageResizerProperties.cs index 3b39a3a722..fd4e69b595 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageResizerProperties.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageResizerProperties.cs @@ -22,7 +22,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib ImageresizerTiffCompressOption = new IntProperty(); ImageresizerFileName = new StringProperty("%1 (%2)"); - ImageresizerSizes = new ImageresizerSizes(new ObservableCollection() + ImageresizerSizes = new ImageResizerSizes(new ObservableCollection() { new ImageSize(0, "Small", ResizeFit.Fit, 854, 480, ResizeUnit.Pixel), new ImageSize(1, "Medium", ResizeFit.Fit, 1366, 768, ResizeUnit.Pixel), @@ -32,7 +32,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib ImageresizerKeepDateModified = new BoolProperty(); ImageresizerFallbackEncoder = new StringProperty(new System.Guid("19e4a5aa-5662-4fc5-a0c0-1758028e1057").ToString()); - ImageresizerCustomSize = new ImageresizerCustomSizeProperty(new ImageSize(4, "custom", ResizeFit.Fit, 1024, 640, ResizeUnit.Pixel)); + ImageresizerCustomSize = new ImageResizerCustomSizeProperty(new ImageSize(4, "custom", ResizeFit.Fit, 1024, 640, ResizeUnit.Pixel)); } [JsonPropertyName("imageresizer_selectedSizeIndex")] @@ -60,7 +60,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib public StringProperty ImageresizerFileName { get; set; } [JsonPropertyName("imageresizer_sizes")] - public ImageresizerSizes ImageresizerSizes { get; set; } + public ImageResizerSizes ImageresizerSizes { get; set; } [JsonPropertyName("imageresizer_keepDateModified")] public BoolProperty ImageresizerKeepDateModified { get; set; } @@ -69,7 +69,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib public StringProperty ImageresizerFallbackEncoder { get; set; } [JsonPropertyName("imageresizer_customSize")] - public ImageresizerCustomSizeProperty ImageresizerCustomSize { get; set; } + public ImageResizerCustomSizeProperty ImageresizerCustomSize { get; set; } public string ToJsonString() { diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageResizerSettings.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageResizerSettings.cs index 1591cbbdb4..fcf512f591 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageResizerSettings.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageResizerSettings.cs @@ -2,33 +2,26 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using System.Collections.Generic; -using System.Text; using System.Text.Json; using System.Text.Json.Serialization; namespace Microsoft.PowerToys.Settings.UI.Lib { - public class ImageResizerSettings + public class ImageResizerSettings : BasePTModuleSettings { - [JsonPropertyName("version")] - public string Version { get; set; } - - [JsonPropertyName("name")] - public string Name { get; set; } + public const string ModuleName = "Image Resizer"; [JsonPropertyName("properties")] public ImageResizerProperties Properties { get; set; } public ImageResizerSettings() { - this.Version = "1"; - this.Name = "Image Resizer"; - this.Properties = new ImageResizerProperties(); + Version = "1"; + Name = ModuleName; + Properties = new ImageResizerProperties(); } - public string ToJsonString() + public override string ToJsonString() { var options = new JsonSerializerOptions { diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImagerResizerKeepDateModified.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImagerResizerKeepDateModified.cs new file mode 100644 index 0000000000..1d9be0d93a --- /dev/null +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImagerResizerKeepDateModified.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Text.Json.Serialization; + +namespace Microsoft.PowerToys.Settings.UI.Lib +{ + public class ImagerResizerKeepDateModified + { + [JsonPropertyName("value")] + public bool Value { get; set; } + + public ImagerResizerKeepDateModified() + { + Value = false; + } + } +} diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerCustomSizeProperty.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerCustomSizeProperty.cs index dab6f3ad4b..71ccd88d8e 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerCustomSizeProperty.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerCustomSizeProperty.cs @@ -1,22 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Text; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + using System.Text.Json.Serialization; namespace Microsoft.PowerToys.Settings.UI.Lib { - - public class ImageresizerCustomSizeProperty + public class ImageResizerCustomSizeProperty { [JsonPropertyName("value")] public ImageSize Value { get; set; } - public ImageresizerCustomSizeProperty() + public ImageResizerCustomSizeProperty() { - this.Value = new ImageSize(); + Value = new ImageSize(); } - public ImageresizerCustomSizeProperty(ImageSize value) + public ImageResizerCustomSizeProperty(ImageSize value) { Value = value; } diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerFallbackEncoder.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerFallbackEncoder.cs index 5c8b785d22..4663d3e381 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerFallbackEncoder.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerFallbackEncoder.cs @@ -1,19 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Text; +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + using System.Text.Json.Serialization; namespace Microsoft.PowerToys.Settings.UI.Lib { - - public class ImageresizerFallbackEncoder + public class ImageResizerFallbackEncoder { [JsonPropertyName("value")] public string Value { get; set; } - public ImageresizerFallbackEncoder() + public ImageResizerFallbackEncoder() { - this.Value = string.Empty; + Value = string.Empty; } } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerKeepDateModified.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerKeepDateModified.cs deleted file mode 100644 index b807eff017..0000000000 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerKeepDateModified.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Text.Json.Serialization; - -namespace Microsoft.PowerToys.Settings.UI.Lib -{ - - public class ImageresizerKeepDateModified - { - [JsonPropertyName("value")] - public bool Value { get; set; } - - public ImageresizerKeepDateModified() - { - this.Value = false; - } - } -} diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerSizes.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerSizes.cs index 3d18b11717..38ae835af1 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerSizes.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ImageresizerSizes.cs @@ -2,27 +2,23 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Text; using System.Text.Json; using System.Text.Json.Serialization; namespace Microsoft.PowerToys.Settings.UI.Lib { - - public class ImageresizerSizes + public class ImageResizerSizes { [JsonPropertyName("value")] public ObservableCollection Value { get; set; } - public ImageresizerSizes() + public ImageResizerSizes() { - this.Value = new ObservableCollection(); + Value = new ObservableCollection(); } - public ImageresizerSizes(ObservableCollection value) + public ImageResizerSizes(ObservableCollection value) { Value = value; } diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/KeyBoardKeysProperty.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/KeyBoardKeysProperty.cs index 188c4287bf..1977918c69 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/KeyBoardKeysProperty.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/KeyBoardKeysProperty.cs @@ -2,23 +2,20 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using System.Collections.Generic; -using System.Text; using System.Text.Json.Serialization; namespace Microsoft.PowerToys.Settings.UI.Lib { - public class KeyBoardKeysProperty + public class KeyboardKeysProperty { - public KeyBoardKeysProperty() + public KeyboardKeysProperty() { - this.Value = new HotkeySettings(); + Value = new HotkeySettings(); } - public KeyBoardKeysProperty(HotkeySettings hkSettings) + public KeyboardKeysProperty(HotkeySettings hkSettings) { - this.Value = hkSettings; + Value = hkSettings; } [JsonPropertyName("value")] diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/KeyboardManagerSettings.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/KeyboardManagerSettings.cs index d5aae938b8..7ac16ffc07 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/KeyboardManagerSettings.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/KeyboardManagerSettings.cs @@ -2,10 +2,6 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; using System.Text.Json.Serialization; namespace Microsoft.PowerToys.Settings.UI.Lib @@ -18,21 +14,15 @@ namespace Microsoft.PowerToys.Settings.UI.Lib public KeyboardManagerSettings() { Properties = new KeyboardManagerProperties(); - version = "1"; - name = "_unset_"; + Version = "1"; + Name = "_unset_"; } public KeyboardManagerSettings(string ptName) { Properties = new KeyboardManagerProperties(); - version = "1"; - name = ptName; - } - - // converts the current to a json string. - public override string ToJsonString() - { - return JsonSerializer.Serialize(this); + Version = "1"; + Name = ptName; } } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerLauncherSettings.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerLauncherSettings.cs index d168cd0acf..b89388ae7d 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerLauncherSettings.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerLauncherSettings.cs @@ -3,20 +3,22 @@ // See the LICENSE file in the project root for more information. using System.Text.Json; +using System.Text.Json.Serialization; namespace Microsoft.PowerToys.Settings.UI.Lib { public class PowerLauncherSettings : BasePTModuleSettings { - public const string POWERTOYNAME = "PowerToys Run"; + public const string ModuleName = "PowerToys Run"; - public PowerLauncherProperties properties { get; set; } + [JsonPropertyName("properties")] + public PowerLauncherProperties Properties { get; set; } public PowerLauncherSettings() { - properties = new PowerLauncherProperties(); - version = "1"; - name = POWERTOYNAME; + Properties = new PowerLauncherProperties(); + Version = "1"; + Name = ModuleName; } public virtual void Save() @@ -27,7 +29,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib WriteIndented = true, }; - SettingsUtils.SaveSettings(JsonSerializer.Serialize(this, options), POWERTOYNAME); + SettingsUtils.SaveSettings(JsonSerializer.Serialize(this, options), ModuleName); } } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerPreviewSettings.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerPreviewSettings.cs index 3a1678d3f8..2b75371e84 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerPreviewSettings.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerPreviewSettings.cs @@ -17,15 +17,15 @@ namespace Microsoft.PowerToys.Settings.UI.Lib public PowerPreviewSettings() { properties = new PowerPreviewProperties(); - version = "1"; - name = "File Explorer"; + Version = "1"; + Name = "File Explorer"; } public PowerPreviewSettings(string ptName) { properties = new PowerPreviewProperties(); - version = "1"; - name = ptName; + Version = "1"; + Name = ptName; } public override string ToJsonString() diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerRenameSettings.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerRenameSettings.cs index cfeecf40c6..a3be125bc5 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerRenameSettings.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerRenameSettings.cs @@ -2,45 +2,42 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System.Text.Json; using System.Text.Json.Serialization; namespace Microsoft.PowerToys.Settings.UI.Lib { public class PowerRenameSettings : BasePTModuleSettings { - public PowerRenameProperties properties { get; set; } + public const string ModuleName = "PowerRename"; + + [JsonPropertyName("properties")] + public PowerRenameProperties Properties { get; set; } public PowerRenameSettings() { - properties = new PowerRenameProperties(); - version = "1"; - name = "PowerRename"; + Properties = new PowerRenameProperties(); + Version = "1"; + Name = ModuleName; } public PowerRenameSettings(PowerRenameLocalProperties localProperties) { - properties = new PowerRenameProperties(); - properties.PersistState.Value = localProperties.PersistState; - properties.MRUEnabled.Value = localProperties.MRUEnabled; - properties.MaxMRUSize.Value = localProperties.MaxMRUSize; - properties.ShowIcon.Value = localProperties.ShowIcon; - properties.ExtendedContextMenuOnly.Value = localProperties.ExtendedContextMenuOnly; + Properties = new PowerRenameProperties(); + Properties.PersistState.Value = localProperties.PersistState; + Properties.MRUEnabled.Value = localProperties.MRUEnabled; + Properties.MaxMRUSize.Value = localProperties.MaxMRUSize; + Properties.ShowIcon.Value = localProperties.ShowIcon; + Properties.ExtendedContextMenuOnly.Value = localProperties.ExtendedContextMenuOnly; - version = "1"; - name = "PowerRename"; + Version = "1"; + Name = ModuleName; } public PowerRenameSettings(string ptName) { - properties = new PowerRenameProperties(); - version = "1"; - name = ptName; - } - - public override string ToJsonString() - { - return JsonSerializer.Serialize(this); + Properties = new PowerRenameProperties(); + Version = "1"; + Name = ptName; } } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ShortcutGuideSettings.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ShortcutGuideSettings.cs index a195f0037f..6b5e41e631 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/ShortcutGuideSettings.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/ShortcutGuideSettings.cs @@ -2,35 +2,22 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; using System.Text.Json.Serialization; namespace Microsoft.PowerToys.Settings.UI.Lib { - public class ShortcutGuideSettings + public class ShortcutGuideSettings : BasePTModuleSettings { - public ShortcutGuideSettings() - { - Name = "Shortcut Guide"; - Properties = new ShortcutGuideProperties(); - Version = "1.0"; - } - - [JsonPropertyName("name")] - public string Name { get; set; } + public const string ModuleName = "Shortcut Guide"; [JsonPropertyName("properties")] public ShortcutGuideProperties Properties { get; set; } - [JsonPropertyName("version")] - public string Version { get; set; } - - public string ToJsonString() + public ShortcutGuideSettings() { - return JsonSerializer.Serialize(this); + Name = ModuleName; + Properties = new ShortcutGuideProperties(); + Version = "1.0"; } } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/ColorPickerViewModel.cs b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/ColorPickerViewModel.cs index 290efa084a..fff0233d0a 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/ColorPickerViewModel.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/ColorPickerViewModel.cs @@ -62,14 +62,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return _colorPickerSettings.properties.ChangeCursor; + return _colorPickerSettings.Properties.ChangeCursor; } set { - if (_colorPickerSettings.properties.ChangeCursor != value) + if (_colorPickerSettings.Properties.ChangeCursor != value) { - _colorPickerSettings.properties.ChangeCursor = value; + _colorPickerSettings.Properties.ChangeCursor = value; OnPropertyChanged(nameof(ChangeCursor)); NotifySettingsChanged(); } @@ -80,14 +80,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return _colorPickerSettings.properties.ActivationShortcut; + return _colorPickerSettings.Properties.ActivationShortcut; } set { - if (_colorPickerSettings.properties.ActivationShortcut != value) + if (_colorPickerSettings.Properties.ActivationShortcut != value) { - _colorPickerSettings.properties.ActivationShortcut = value; + _colorPickerSettings.Properties.ActivationShortcut = value; OnPropertyChanged(nameof(ActivationShortcut)); NotifySettingsChanged(); } @@ -98,14 +98,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return (int)_colorPickerSettings.properties.CopiedColorRepresentation; + return (int)_colorPickerSettings.Properties.CopiedColorRepresentation; } set { - if (_colorPickerSettings.properties.CopiedColorRepresentation != (ColorRepresentationType)value) + if (_colorPickerSettings.Properties.CopiedColorRepresentation != (ColorRepresentationType)value) { - _colorPickerSettings.properties.CopiedColorRepresentation = (ColorRepresentationType)value; + _colorPickerSettings.Properties.CopiedColorRepresentation = (ColorRepresentationType)value; OnPropertyChanged(nameof(CopiedColorRepresentationIndex)); NotifySettingsChanged(); } diff --git a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/ImageResizerViewModel.cs b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/ImageResizerViewModel.cs index b63c7b21a5..16153b1e3d 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/ImageResizerViewModel.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/ImageResizerViewModel.cs @@ -106,7 +106,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { SettingsUtils.SaveSettings(Settings.Properties.ImageresizerSizes.ToJsonString(), ModuleName, "sizes.json"); _advancedSizes = value; - Settings.Properties.ImageresizerSizes = new ImageresizerSizes(value); + Settings.Properties.ImageresizerSizes = new ImageResizerSizes(value); SettingsUtils.SaveSettings(Settings.ToJsonString(), ModuleName); OnPropertyChanged("Sizes"); } diff --git a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerLauncherViewModel.cs b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerLauncherViewModel.cs index d2a53aec6b..5e4bc01f18 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerLauncherViewModel.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerLauncherViewModel.cs @@ -25,18 +25,18 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { // Propagate changes to Power Launcher through IPC ShellPage.DefaultSndMSGCallback( - string.Format("{{ \"powertoys\": {{ \"{0}\": {1} }} }}", PowerLauncherSettings.POWERTOYNAME, JsonSerializer.Serialize(settings))); + string.Format("{{ \"powertoys\": {{ \"{0}\": {1} }} }}", PowerLauncherSettings.ModuleName, JsonSerializer.Serialize(settings))); }; - if (SettingsUtils.SettingsExists(PowerLauncherSettings.POWERTOYNAME)) + if (SettingsUtils.SettingsExists(PowerLauncherSettings.ModuleName)) { - settings = SettingsUtils.GetSettings(PowerLauncherSettings.POWERTOYNAME); + settings = SettingsUtils.GetSettings(PowerLauncherSettings.ModuleName); } else { settings = new PowerLauncherSettings(); - settings.properties.open_powerlauncher.Alt = true; - settings.properties.open_powerlauncher.Code = (int)Windows.System.VirtualKey.Space; - settings.properties.maximum_number_of_results = 4; + settings.Properties.open_powerlauncher.Alt = true; + settings.Properties.open_powerlauncher.Code = (int)Windows.System.VirtualKey.Space; + settings.Properties.maximum_number_of_results = 4; callback(settings); } @@ -87,14 +87,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return settings.properties.search_result_preference; + return settings.Properties.search_result_preference; } set { - if (settings.properties.search_result_preference != value) + if (settings.Properties.search_result_preference != value) { - settings.properties.search_result_preference = value; + settings.Properties.search_result_preference = value; UpdateSettings(); } } @@ -104,14 +104,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return settings.properties.search_type_preference; + return settings.Properties.search_type_preference; } set { - if (settings.properties.search_type_preference != value) + if (settings.Properties.search_type_preference != value) { - settings.properties.search_type_preference = value; + settings.Properties.search_type_preference = value; UpdateSettings(); } } @@ -121,14 +121,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return settings.properties.maximum_number_of_results; + return settings.Properties.maximum_number_of_results; } set { - if (settings.properties.maximum_number_of_results != value) + if (settings.Properties.maximum_number_of_results != value) { - settings.properties.maximum_number_of_results = value; + settings.Properties.maximum_number_of_results = value; UpdateSettings(); } } @@ -138,14 +138,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return settings.properties.open_powerlauncher; + return settings.Properties.open_powerlauncher; } set { - if (settings.properties.open_powerlauncher != value) + if (settings.Properties.open_powerlauncher != value) { - settings.properties.open_powerlauncher = value; + settings.Properties.open_powerlauncher = value; UpdateSettings(); } } @@ -155,14 +155,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return settings.properties.open_file_location; + return settings.Properties.open_file_location; } set { - if (settings.properties.open_file_location != value) + if (settings.Properties.open_file_location != value) { - settings.properties.open_file_location = value; + settings.Properties.open_file_location = value; UpdateSettings(); } } @@ -172,14 +172,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return settings.properties.copy_path_location; + return settings.Properties.copy_path_location; } set { - if (settings.properties.copy_path_location != value) + if (settings.Properties.copy_path_location != value) { - settings.properties.copy_path_location = value; + settings.Properties.copy_path_location = value; UpdateSettings(); } } @@ -189,14 +189,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return settings.properties.override_win_r_key; + return settings.Properties.override_win_r_key; } set { - if (settings.properties.override_win_r_key != value) + if (settings.Properties.override_win_r_key != value) { - settings.properties.override_win_r_key = value; + settings.Properties.override_win_r_key = value; UpdateSettings(); } } @@ -206,14 +206,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return settings.properties.override_win_s_key; + return settings.Properties.override_win_s_key; } set { - if (settings.properties.override_win_s_key != value) + if (settings.Properties.override_win_s_key != value) { - settings.properties.override_win_s_key = value; + settings.Properties.override_win_s_key = value; UpdateSettings(); } } @@ -223,14 +223,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return settings.properties.ignore_hotkeys_in_fullscreen; + return settings.Properties.ignore_hotkeys_in_fullscreen; } set { - if (settings.properties.ignore_hotkeys_in_fullscreen != value) + if (settings.Properties.ignore_hotkeys_in_fullscreen != value) { - settings.properties.ignore_hotkeys_in_fullscreen = value; + settings.Properties.ignore_hotkeys_in_fullscreen = value; UpdateSettings(); } } @@ -240,14 +240,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return settings.properties.clear_input_on_launch; + return settings.Properties.clear_input_on_launch; } set { - if (settings.properties.clear_input_on_launch != value) + if (settings.Properties.clear_input_on_launch != value) { - settings.properties.clear_input_on_launch = value; + settings.Properties.clear_input_on_launch = value; UpdateSettings(); } } @@ -257,14 +257,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { get { - return settings.properties.disable_drive_detection_warning; + return settings.Properties.disable_drive_detection_warning; } set { - if (settings.properties.disable_drive_detection_warning != value) + if (settings.Properties.disable_drive_detection_warning != value) { - settings.properties.disable_drive_detection_warning = value; + settings.Properties.disable_drive_detection_warning = value; UpdateSettings(); } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerRenameViewModel.cs b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerRenameViewModel.cs index 27c53a330d..3e47cedd04 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerRenameViewModel.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerRenameViewModel.cs @@ -29,11 +29,11 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels SettingsUtils.SaveSettings(localSettings.ToJsonString(), ModuleName, "power-rename-settings.json"); } - _powerRenameEnabledOnContextMenu = Settings.properties.ShowIcon.Value; - _powerRenameEnabledOnContextExtendedMenu = Settings.properties.ExtendedContextMenuOnly.Value; - _powerRenameRestoreFlagsOnLaunch = Settings.properties.PersistState.Value; - _powerRenameMaxDispListNumValue = Settings.properties.MaxMRUSize.Value; - _autoComplete = Settings.properties.MRUEnabled.Value; + _powerRenameEnabledOnContextMenu = Settings.Properties.ShowIcon.Value; + _powerRenameEnabledOnContextExtendedMenu = Settings.Properties.ExtendedContextMenuOnly.Value; + _powerRenameRestoreFlagsOnLaunch = Settings.Properties.PersistState.Value; + _powerRenameMaxDispListNumValue = Settings.Properties.MaxMRUSize.Value; + _autoComplete = Settings.Properties.MRUEnabled.Value; GeneralSettings generalSettings; try @@ -94,7 +94,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels if (value != _autoComplete) { _autoComplete = value; - Settings.properties.MRUEnabled.Value = value; + Settings.Properties.MRUEnabled.Value = value; RaisePropertyChanged(); RaisePropertyChanged("GlobalAndMruEnabled"); } @@ -122,7 +122,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels if (value != _powerRenameEnabledOnContextMenu) { _powerRenameEnabledOnContextMenu = value; - Settings.properties.ShowIcon.Value = value; + Settings.Properties.ShowIcon.Value = value; RaisePropertyChanged(); } } @@ -140,7 +140,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels if (value != _powerRenameEnabledOnContextExtendedMenu) { _powerRenameEnabledOnContextExtendedMenu = value; - Settings.properties.ExtendedContextMenuOnly.Value = value; + Settings.Properties.ExtendedContextMenuOnly.Value = value; RaisePropertyChanged(); } } @@ -158,7 +158,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels if (value != _powerRenameRestoreFlagsOnLaunch) { _powerRenameRestoreFlagsOnLaunch = value; - Settings.properties.PersistState.Value = value; + Settings.Properties.PersistState.Value = value; RaisePropertyChanged(); } } @@ -176,7 +176,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels if (value != _powerRenameMaxDispListNumValue) { _powerRenameMaxDispListNumValue = value; - Settings.properties.MaxMRUSize.Value = value; + Settings.Properties.MaxMRUSize.Value = value; RaisePropertyChanged(); } } diff --git a/src/core/Microsoft.PowerToys.Settings.UnitTest/ModelsTests/BasePTSettingsTest.cs b/src/core/Microsoft.PowerToys.Settings.UnitTest/ModelsTests/BasePTSettingsTest.cs index 87b412bb0c..72bf7a8809 100644 --- a/src/core/Microsoft.PowerToys.Settings.UnitTest/ModelsTests/BasePTSettingsTest.cs +++ b/src/core/Microsoft.PowerToys.Settings.UnitTest/ModelsTests/BasePTSettingsTest.cs @@ -6,8 +6,8 @@ namespace Microsoft.PowerToys.Settings.UnitTest { public BasePTSettingsTest() { - this.name = string.Empty; - this.version = string.Empty; + Name = string.Empty; + Version = string.Empty; } } } \ No newline at end of file diff --git a/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/ColorPicker.cs b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/ColorPicker.cs index da0ceda8c5..63fd7da24e 100644 --- a/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/ColorPicker.cs +++ b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/ColorPicker.cs @@ -19,7 +19,7 @@ namespace ViewModelTests var colorPickerSettings = new ColorPickerSettings(); SettingsUtils.SaveSettings(generalSettings.ToJsonString()); - SettingsUtils.SaveSettings(colorPickerSettings.ToJsonString(), colorPickerSettings.name, ModuleName + ".json"); + SettingsUtils.SaveSettings(colorPickerSettings.ToJsonString(), colorPickerSettings.Name, ModuleName + ".json"); } [TestCleanup] diff --git a/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/PowerLauncherViewModelTest.cs b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/PowerLauncherViewModelTest.cs index 2b562fdbdc..9cdf51e5bd 100644 --- a/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/PowerLauncherViewModelTest.cs +++ b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/PowerLauncherViewModelTest.cs @@ -45,8 +45,8 @@ namespace ViewModelTests viewModel.SearchTypePreference = "SearchOptionsAreNotValidated"; Assert.AreEqual(sendCallbackMock.TimesSent, 2); - Assert.IsTrue(mockSettings.properties.search_result_preference == "SearchOptionsAreNotValidated"); - Assert.IsTrue(mockSettings.properties.search_type_preference == "SearchOptionsAreNotValidated"); + Assert.IsTrue(mockSettings.Properties.search_result_preference == "SearchOptionsAreNotValidated"); + Assert.IsTrue(mockSettings.Properties.search_type_preference == "SearchOptionsAreNotValidated"); } public void AssertHotkeySettings(HotkeySettings setting, bool win, bool ctrl, bool alt, bool shift, int code) @@ -85,7 +85,7 @@ namespace ViewModelTests Assert.AreEqual(4, sendCallbackMock.TimesSent); AssertHotkeySettings( - mockSettings.properties.open_powerlauncher, + mockSettings.Properties.open_powerlauncher, true, false, false, @@ -93,7 +93,7 @@ namespace ViewModelTests (int)Windows.System.VirtualKey.S ); AssertHotkeySettings( - mockSettings.properties.open_file_location, + mockSettings.Properties.open_file_location, false, true, false, @@ -101,7 +101,7 @@ namespace ViewModelTests (int)Windows.System.VirtualKey.A ); AssertHotkeySettings( - mockSettings.properties.open_console, + mockSettings.Properties.open_console, false, false, true, @@ -109,7 +109,7 @@ namespace ViewModelTests (int)Windows.System.VirtualKey.D ); AssertHotkeySettings( - mockSettings.properties.copy_path_location, + mockSettings.Properties.copy_path_location, false, false, false, @@ -127,8 +127,8 @@ namespace ViewModelTests Assert.AreEqual(1, sendCallbackMock.TimesSent); - Assert.IsTrue(mockSettings.properties.override_win_r_key); - Assert.IsFalse(mockSettings.properties.override_win_s_key); + Assert.IsTrue(mockSettings.Properties.override_win_r_key); + Assert.IsFalse(mockSettings.Properties.override_win_s_key); } [TestMethod] @@ -139,7 +139,7 @@ namespace ViewModelTests // Assert Assert.AreEqual(1, sendCallbackMock.TimesSent); - Assert.IsTrue(mockSettings.properties.disable_drive_detection_warning); + Assert.IsTrue(mockSettings.Properties.disable_drive_detection_warning); } } } diff --git a/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/PowerPreview.cs b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/PowerPreview.cs index b95f1b3c4c..d9825eb41d 100644 --- a/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/PowerPreview.cs +++ b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/PowerPreview.cs @@ -25,7 +25,7 @@ namespace ViewModelTests PowerPreviewSettings powerpreview = new PowerPreviewSettings(); SettingsUtils.SaveSettings(generalSettings.ToJsonString()); - SettingsUtils.SaveSettings(powerpreview.ToJsonString(), powerpreview.name); + SettingsUtils.SaveSettings(powerpreview.ToJsonString(), powerpreview.Name); } [TestCleanup] diff --git a/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/PowerRename.cs b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/PowerRename.cs index a094bf9035..b1a0b7c681 100644 --- a/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/PowerRename.cs +++ b/src/core/Microsoft.PowerToys.Settings.UnitTest/ViewModelTests/PowerRename.cs @@ -26,7 +26,7 @@ namespace ViewModelTests PowerRenameSettings powerRename = new PowerRenameSettings(); SettingsUtils.SaveSettings(generalSettings.ToJsonString()); - SettingsUtils.SaveSettings(powerRename.ToJsonString(), powerRename.name, "power-rename-settings.json"); + SettingsUtils.SaveSettings(powerRename.ToJsonString(), powerRename.Name, "power-rename-settings.json"); } [TestCleanup] @@ -73,7 +73,7 @@ namespace ViewModelTests ShellPage.DefaultSndMSGCallback = msg => { PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize(msg); - Assert.IsTrue(snd.Powertoys.PowerRename.properties.MRUEnabled.Value); + Assert.IsTrue(snd.Powertoys.PowerRename.Properties.MRUEnabled.Value); }; // act @@ -139,7 +139,7 @@ namespace ViewModelTests ShellPage.DefaultSndMSGCallback = msg => { PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize(msg); - Assert.IsTrue(snd.Powertoys.PowerRename.properties.ShowIcon.Value); + Assert.IsTrue(snd.Powertoys.PowerRename.Properties.ShowIcon.Value); }; // act @@ -156,7 +156,7 @@ namespace ViewModelTests ShellPage.DefaultSndMSGCallback = msg => { PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize(msg); - Assert.IsTrue(snd.Powertoys.PowerRename.properties.ShowIcon.Value); + Assert.IsTrue(snd.Powertoys.PowerRename.Properties.ShowIcon.Value); }; // act @@ -173,7 +173,7 @@ namespace ViewModelTests ShellPage.DefaultSndMSGCallback = msg => { PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize(msg); - Assert.IsTrue(snd.Powertoys.PowerRename.properties.PersistState.Value); + Assert.IsTrue(snd.Powertoys.PowerRename.Properties.PersistState.Value); }; // act @@ -190,7 +190,7 @@ namespace ViewModelTests ShellPage.DefaultSndMSGCallback = msg => { PowerRenameSettingsIPCMessage snd = JsonSerializer.Deserialize(msg); - Assert.AreEqual(20, snd.Powertoys.PowerRename.properties.MaxMRUSize.Value); + Assert.AreEqual(20, snd.Powertoys.PowerRename.Properties.MaxMRUSize.Value); }; // act diff --git a/src/modules/colorPicker/ColorPickerUI/Settings/UserSettings.cs b/src/modules/colorPicker/ColorPickerUI/Settings/UserSettings.cs index 54de059277..0f7bb853ce 100644 --- a/src/modules/colorPicker/ColorPickerUI/Settings/UserSettings.cs +++ b/src/modules/colorPicker/ColorPickerUI/Settings/UserSettings.cs @@ -60,9 +60,9 @@ namespace ColorPicker.Settings var settings = SettingsUtils.GetSettings(ColorPickerModuleName); if (settings != null) { - ChangeCursor.Value = settings.properties.ChangeCursor; - ActivationShortcut.Value = settings.properties.ActivationShortcut.ToString(); - CopiedColorRepresentation.Value = settings.properties.CopiedColorRepresentation; + ChangeCursor.Value = settings.Properties.ChangeCursor; + ActivationShortcut.Value = settings.Properties.ActivationShortcut.ToString(); + CopiedColorRepresentation.Value = settings.Properties.CopiedColorRepresentation; } retry = false; diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Main.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Main.cs index e7c4d73519..469be74705 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Main.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Main.cs @@ -202,8 +202,8 @@ namespace Microsoft.Plugin.Indexer } public void UpdateSettings(PowerLauncherSettings settings) { - _settings.MaxSearchCount = settings.properties.maximum_number_of_results; - _driveDetection.IsDriveDetectionWarningCheckBoxSelected = settings.properties.disable_drive_detection_warning; + _settings.MaxSearchCount = settings.Properties.maximum_number_of_results; + _driveDetection.IsDriveDetectionWarningCheckBoxSelected = settings.Properties.disable_drive_detection_warning; } public Control CreateSettingPanel() { diff --git a/src/modules/launcher/PowerLauncher/SettingsWatcher.cs b/src/modules/launcher/PowerLauncher/SettingsWatcher.cs index 588517819b..5270c4a8b3 100644 --- a/src/modules/launcher/PowerLauncher/SettingsWatcher.cs +++ b/src/modules/launcher/PowerLauncher/SettingsWatcher.cs @@ -26,7 +26,7 @@ namespace PowerLauncher { _settings = settings; // Set up watcher - _watcher = Microsoft.PowerToys.Settings.UI.Lib.Utilities.Helper.GetFileWatcher(PowerLauncherSettings.POWERTOYNAME, "settings.json", OverloadSettings); + _watcher = Microsoft.PowerToys.Settings.UI.Lib.Utilities.Helper.GetFileWatcher(PowerLauncherSettings.ModuleName, "settings.json", OverloadSettings); // Load initial settings file OverloadSettings(); @@ -41,9 +41,9 @@ namespace PowerLauncher retry = false; try { - var overloadSettings = SettingsUtils.GetSettings(PowerLauncherSettings.POWERTOYNAME); + var overloadSettings = SettingsUtils.GetSettings(PowerLauncherSettings.ModuleName); - var openPowerlauncher = ConvertHotkey(overloadSettings.properties.open_powerlauncher); + var openPowerlauncher = ConvertHotkey(overloadSettings.Properties.open_powerlauncher); if (_settings.Hotkey != openPowerlauncher) { _settings.Hotkey = openPowerlauncher; @@ -56,14 +56,14 @@ namespace PowerLauncher shellSettings.UpdateSettings(overloadSettings); } - if (_settings.MaxResultsToShow != overloadSettings.properties.maximum_number_of_results) + if (_settings.MaxResultsToShow != overloadSettings.Properties.maximum_number_of_results) { - _settings.MaxResultsToShow = overloadSettings.properties.maximum_number_of_results; + _settings.MaxResultsToShow = overloadSettings.Properties.maximum_number_of_results; } - if (_settings.IgnoreHotkeysOnFullscreen != overloadSettings.properties.ignore_hotkeys_in_fullscreen) + if (_settings.IgnoreHotkeysOnFullscreen != overloadSettings.Properties.ignore_hotkeys_in_fullscreen) { - _settings.IgnoreHotkeysOnFullscreen = overloadSettings.properties.ignore_hotkeys_in_fullscreen; + _settings.IgnoreHotkeysOnFullscreen = overloadSettings.Properties.ignore_hotkeys_in_fullscreen; } var indexer = PluginManager.AllPlugins.Find(p => p.Metadata.Name.Equals("Windows Indexer Plugin", StringComparison.OrdinalIgnoreCase)); @@ -73,9 +73,9 @@ namespace PowerLauncher indexerSettings.UpdateSettings(overloadSettings); } - if (_settings.ClearInputOnLaunch != overloadSettings.properties.clear_input_on_launch) + if (_settings.ClearInputOnLaunch != overloadSettings.Properties.clear_input_on_launch) { - _settings.ClearInputOnLaunch = overloadSettings.properties.clear_input_on_launch; + _settings.ClearInputOnLaunch = overloadSettings.Properties.clear_input_on_launch; } } // the settings application can hold a lock on the settings.json file which will result in a IOException.