mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-19 06:53:26 +08:00
[warningsAsErrors] Getting settings online (#6053)
* getting everything to compile * fixing json
This commit is contained in:
parent
9724afd9ec
commit
dc744f236e
@ -3,9 +3,7 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib.Utilities;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
public virtual string ToJsonString()
|
||||
{
|
||||
// By default JsonSerializer will only serialize the properties in the base class. This can be avoided by passing the object type (more details at https://stackoverflow.com/a/62498888)
|
||||
return JsonSerializer.Serialize(this, this.GetType());
|
||||
return JsonSerializer.Serialize(this, GetType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +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;
|
||||
|
||||
@ -14,7 +11,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
{
|
||||
public BoolProperty()
|
||||
{
|
||||
this.Value = false;
|
||||
Value = false;
|
||||
}
|
||||
|
||||
public BoolProperty(bool value)
|
||||
|
@ -3,8 +3,6 @@
|
||||
// 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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
{
|
||||
public static class ConfigDefaults
|
||||
|
@ -12,7 +12,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
{
|
||||
public DoubleProperty()
|
||||
{
|
||||
this.Value = 0.0;
|
||||
Value = 0.0;
|
||||
}
|
||||
|
||||
public DoubleProperty(double value)
|
||||
|
@ -21,13 +21,13 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
[JsonPropertyName("FancyZones")]
|
||||
public bool FancyZones
|
||||
{
|
||||
get => this.fancyZones;
|
||||
get => fancyZones;
|
||||
set
|
||||
{
|
||||
if (this.fancyZones != value)
|
||||
if (fancyZones != value)
|
||||
{
|
||||
LogTelemetryEvent(value);
|
||||
this.fancyZones = value;
|
||||
fancyZones = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -37,13 +37,13 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
[JsonPropertyName("Image Resizer")]
|
||||
public bool ImageResizer
|
||||
{
|
||||
get => this.imageResizer;
|
||||
get => imageResizer;
|
||||
set
|
||||
{
|
||||
if (this.imageResizer != value)
|
||||
if (imageResizer != value)
|
||||
{
|
||||
LogTelemetryEvent(value);
|
||||
this.imageResizer = value;
|
||||
imageResizer = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -53,13 +53,13 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
[JsonPropertyName("File Explorer Preview")]
|
||||
public bool FileExplorerPreview
|
||||
{
|
||||
get => this.fileExplorerPreview;
|
||||
get => fileExplorerPreview;
|
||||
set
|
||||
{
|
||||
if (this.fileExplorerPreview != value)
|
||||
if (fileExplorerPreview != value)
|
||||
{
|
||||
LogTelemetryEvent(value);
|
||||
this.fileExplorerPreview = value;
|
||||
fileExplorerPreview = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -69,13 +69,13 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
[JsonPropertyName("Shortcut Guide")]
|
||||
public bool ShortcutGuide
|
||||
{
|
||||
get => this.shortcutGuide;
|
||||
get => shortcutGuide;
|
||||
set
|
||||
{
|
||||
if (this.shortcutGuide != value)
|
||||
if (shortcutGuide != value)
|
||||
{
|
||||
LogTelemetryEvent(value);
|
||||
this.shortcutGuide = value;
|
||||
shortcutGuide = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -84,13 +84,13 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
public bool PowerRename
|
||||
{
|
||||
get => this.powerRename;
|
||||
get => powerRename;
|
||||
set
|
||||
{
|
||||
if (this.powerRename != value)
|
||||
if (powerRename != value)
|
||||
{
|
||||
LogTelemetryEvent(value);
|
||||
this.powerRename = value;
|
||||
powerRename = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -100,13 +100,13 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
[JsonPropertyName("Keyboard Manager")]
|
||||
public bool KeyboardManager
|
||||
{
|
||||
get => this.keyboardManager;
|
||||
get => keyboardManager;
|
||||
set
|
||||
{
|
||||
if (this.keyboardManager != value)
|
||||
if (keyboardManager != value)
|
||||
{
|
||||
LogTelemetryEvent(value);
|
||||
this.keyboardManager = value;
|
||||
keyboardManager = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -116,13 +116,13 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
[JsonPropertyName("PowerToys Run")]
|
||||
public bool PowerLauncher
|
||||
{
|
||||
get => this.powerLauncher;
|
||||
get => powerLauncher;
|
||||
set
|
||||
{
|
||||
if (this.powerLauncher != value)
|
||||
if (powerLauncher != value)
|
||||
{
|
||||
LogTelemetryEvent(value);
|
||||
this.powerLauncher = value;
|
||||
powerLauncher = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -132,13 +132,13 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
[JsonPropertyName("ColorPicker")]
|
||||
public bool ColorPicker
|
||||
{
|
||||
get => this.colorPicker;
|
||||
get => colorPicker;
|
||||
set
|
||||
{
|
||||
if (this.colorPicker != value)
|
||||
if (colorPicker != value)
|
||||
{
|
||||
LogTelemetryEvent(value);
|
||||
this.colorPicker = value;
|
||||
colorPicker = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +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;
|
||||
|
||||
@ -21,7 +18,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
public FancyZonesSettingsIPCMessage(SndFancyZonesSettings settings)
|
||||
{
|
||||
this.Powertoys = settings;
|
||||
Powertoys = settings;
|
||||
}
|
||||
|
||||
public string ToJsonString()
|
||||
|
@ -52,24 +52,24 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
public GeneralSettings()
|
||||
{
|
||||
this.Packaged = false;
|
||||
this.Startup = false;
|
||||
this.IsAdmin = false;
|
||||
this.IsElevated = false;
|
||||
this.AutoDownloadUpdates = false;
|
||||
this.Theme = "system";
|
||||
this.SystemTheme = "light";
|
||||
Packaged = false;
|
||||
Startup = false;
|
||||
IsAdmin = false;
|
||||
IsElevated = false;
|
||||
AutoDownloadUpdates = false;
|
||||
Theme = "system";
|
||||
SystemTheme = "light";
|
||||
try
|
||||
{
|
||||
this.PowertoysVersion = DefaultPowertoysVersion();
|
||||
PowertoysVersion = DefaultPowertoysVersion();
|
||||
}
|
||||
catch
|
||||
{
|
||||
this.PowertoysVersion = "v0.0.0";
|
||||
PowertoysVersion = "v0.0.0";
|
||||
}
|
||||
|
||||
this.Enabled = new EnabledModules();
|
||||
this.CustomActionName = string.Empty;
|
||||
Enabled = new EnabledModules();
|
||||
CustomActionName = string.Empty;
|
||||
}
|
||||
|
||||
// converts the current to a json string.
|
||||
|
@ -2,7 +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.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
@ -2,7 +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.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
@ -2,11 +2,8 @@
|
||||
// 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.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
|
@ -12,7 +12,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
{
|
||||
public IntProperty()
|
||||
{
|
||||
this.Value = 0;
|
||||
Value = 0;
|
||||
}
|
||||
|
||||
public IntProperty(int value)
|
||||
|
@ -2,7 +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.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
@ -14,6 +14,7 @@
|
||||
<RepositoryType>Github</RepositoryType>
|
||||
<PackageTags>PowerToys</PackageTags>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
|
@ -18,13 +18,13 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
[JsonConverter(typeof(BoolPropertyJsonConverter))]
|
||||
public bool EnableSvgPreview
|
||||
{
|
||||
get => this.enableSvgPreview;
|
||||
get => enableSvgPreview;
|
||||
set
|
||||
{
|
||||
if (value != this.enableSvgPreview)
|
||||
if (value != enableSvgPreview)
|
||||
{
|
||||
LogTelemetryEvent(value);
|
||||
this.enableSvgPreview = value;
|
||||
enableSvgPreview = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -35,13 +35,13 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
[JsonConverter(typeof(BoolPropertyJsonConverter))]
|
||||
public bool EnableSvgThumbnail
|
||||
{
|
||||
get => this.enableSvgThumbnail;
|
||||
get => enableSvgThumbnail;
|
||||
set
|
||||
{
|
||||
if (value != this.enableSvgThumbnail)
|
||||
if (value != enableSvgThumbnail)
|
||||
{
|
||||
LogTelemetryEvent(value);
|
||||
this.enableSvgThumbnail = value;
|
||||
enableSvgThumbnail = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -52,13 +52,13 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
[JsonConverter(typeof(BoolPropertyJsonConverter))]
|
||||
public bool EnableMdPreview
|
||||
{
|
||||
get => this.enableMdPreview;
|
||||
get => enableMdPreview;
|
||||
set
|
||||
{
|
||||
if (value != this.enableMdPreview)
|
||||
if (value != enableMdPreview)
|
||||
{
|
||||
LogTelemetryEvent(value);
|
||||
this.enableMdPreview = value;
|
||||
enableMdPreview = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
// 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
|
||||
{
|
||||
|
@ -2,9 +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;
|
||||
|
||||
@ -21,7 +18,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
public PowerRenameSettingsIPCMessage(SndPowerRenameSettings settings)
|
||||
{
|
||||
this.Powertoys = settings;
|
||||
Powertoys = settings;
|
||||
}
|
||||
|
||||
public string ToJsonString()
|
||||
|
@ -2,9 +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.Serialization;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
@ -2,9 +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;
|
||||
|
||||
@ -21,7 +18,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
public ShortcutGuideSettingsIPCMessage(SndShortcutGuideSettings settings)
|
||||
{
|
||||
this.Powertoys = settings;
|
||||
Powertoys = settings;
|
||||
}
|
||||
|
||||
public string ToJsonString()
|
||||
|
@ -2,11 +2,7 @@
|
||||
// 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
|
||||
{
|
||||
@ -20,7 +16,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
public SndFancyZonesSettings(FancyZonesSettings settings)
|
||||
{
|
||||
this.FancyZones = settings;
|
||||
FancyZones = settings;
|
||||
}
|
||||
|
||||
public string ToJsonString()
|
||||
|
@ -2,9 +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;
|
||||
|
||||
@ -17,7 +14,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
public SndImageResizerSettings(ImageResizerSettings settings)
|
||||
{
|
||||
this.ImageResizer = settings;
|
||||
ImageResizer = settings;
|
||||
}
|
||||
|
||||
public string ToJsonString()
|
||||
|
@ -3,13 +3,15 @@
|
||||
// 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
|
||||
{
|
||||
// Represents a powertoys module settings setnt to the runner.
|
||||
public class SndModuleSettings<T>
|
||||
{
|
||||
public T powertoys { get; set; }
|
||||
[JsonPropertyName("powertoys")]
|
||||
public T PowertoysSetting { get; set; }
|
||||
|
||||
public SndModuleSettings()
|
||||
{
|
||||
@ -17,7 +19,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
public SndModuleSettings(T settings)
|
||||
{
|
||||
this.powertoys = settings;
|
||||
PowertoysSetting = settings;
|
||||
}
|
||||
|
||||
public string ToJsonString()
|
||||
|
@ -2,9 +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;
|
||||
|
||||
|
@ -2,9 +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;
|
||||
|
||||
@ -21,7 +18,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
public SndShortcutGuideSettings(ShortcutGuideSettings settings)
|
||||
{
|
||||
this.ShortcutGuide = settings;
|
||||
ShortcutGuide = settings;
|
||||
}
|
||||
|
||||
public string ToJsonString()
|
||||
|
@ -2,9 +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;
|
||||
|
||||
@ -15,7 +12,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
{
|
||||
public StringProperty()
|
||||
{
|
||||
this.Value = string.Empty;
|
||||
Value = string.Empty;
|
||||
}
|
||||
|
||||
public StringProperty(string value)
|
||||
|
@ -7,9 +7,6 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib.CustomAction;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Lib.Utilities
|
||||
|
@ -13,7 +13,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels.Commands
|
||||
|
||||
public ButtonClickCommand(Action execute)
|
||||
{
|
||||
this._execute = execute;
|
||||
_execute = execute;
|
||||
}
|
||||
|
||||
// Occurs when changes occur that affect whether or not the command should execute.
|
||||
@ -30,5 +30,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels.Commands
|
||||
{
|
||||
_execute();
|
||||
}
|
||||
|
||||
public void OnCanExecuteChanged() => CanExecuteChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
@ -35,35 +35,35 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
SettingsUtils.SaveSettings(Settings.ToJsonString(), GetSettingsSubPath());
|
||||
}
|
||||
|
||||
this.LaunchEditorEventHandler = new ButtonClickCommand(LaunchEditor);
|
||||
LaunchEditorEventHandler = new ButtonClickCommand(LaunchEditor);
|
||||
|
||||
this._shiftDrag = Settings.Properties.FancyzonesShiftDrag.Value;
|
||||
this._mouseSwitch = Settings.Properties.FancyzonesMouseSwitch.Value;
|
||||
this._overrideSnapHotkeys = Settings.Properties.FancyzonesOverrideSnapHotkeys.Value;
|
||||
this._moveWindowsAcrossMonitors = Settings.Properties.FancyzonesMoveWindowsAcrossMonitors.Value;
|
||||
this._displayChangemoveWindows = Settings.Properties.FancyzonesDisplayChangeMoveWindows.Value;
|
||||
this._zoneSetChangeMoveWindows = Settings.Properties.FancyzonesZoneSetChangeMoveWindows.Value;
|
||||
this._appLastZoneMoveWindows = Settings.Properties.FancyzonesAppLastZoneMoveWindows.Value;
|
||||
this._openWindowOnActiveMonitor = Settings.Properties.FancyzonesOpenWindowOnActiveMonitor.Value;
|
||||
this._restoreSize = Settings.Properties.FancyzonesRestoreSize.Value;
|
||||
this._useCursorPosEditorStartupScreen = Settings.Properties.UseCursorposEditorStartupscreen.Value;
|
||||
this._showOnAllMonitors = Settings.Properties.FancyzonesShowOnAllMonitors.Value;
|
||||
this._makeDraggedWindowTransparent = Settings.Properties.FancyzonesMakeDraggedWindowTransparent.Value;
|
||||
this._highlightOpacity = Settings.Properties.FancyzonesHighlightOpacity.Value;
|
||||
this._excludedApps = Settings.Properties.FancyzonesExcludedApps.Value;
|
||||
this.EditorHotkey = Settings.Properties.FancyzonesEditorHotkey.Value;
|
||||
_shiftDrag = Settings.Properties.FancyzonesShiftDrag.Value;
|
||||
_mouseSwitch = Settings.Properties.FancyzonesMouseSwitch.Value;
|
||||
_overrideSnapHotkeys = Settings.Properties.FancyzonesOverrideSnapHotkeys.Value;
|
||||
_moveWindowsAcrossMonitors = Settings.Properties.FancyzonesMoveWindowsAcrossMonitors.Value;
|
||||
_displayChangemoveWindows = Settings.Properties.FancyzonesDisplayChangeMoveWindows.Value;
|
||||
_zoneSetChangeMoveWindows = Settings.Properties.FancyzonesZoneSetChangeMoveWindows.Value;
|
||||
_appLastZoneMoveWindows = Settings.Properties.FancyzonesAppLastZoneMoveWindows.Value;
|
||||
_openWindowOnActiveMonitor = Settings.Properties.FancyzonesOpenWindowOnActiveMonitor.Value;
|
||||
_restoreSize = Settings.Properties.FancyzonesRestoreSize.Value;
|
||||
_useCursorPosEditorStartupScreen = Settings.Properties.UseCursorposEditorStartupscreen.Value;
|
||||
_showOnAllMonitors = Settings.Properties.FancyzonesShowOnAllMonitors.Value;
|
||||
_makeDraggedWindowTransparent = Settings.Properties.FancyzonesMakeDraggedWindowTransparent.Value;
|
||||
_highlightOpacity = Settings.Properties.FancyzonesHighlightOpacity.Value;
|
||||
_excludedApps = Settings.Properties.FancyzonesExcludedApps.Value;
|
||||
EditorHotkey = Settings.Properties.FancyzonesEditorHotkey.Value;
|
||||
|
||||
// set the callback functions value to hangle outgoing IPC message.
|
||||
SendConfigMSG = ipcMSGCallBackFunc;
|
||||
|
||||
string inactiveColor = Settings.Properties.FancyzonesInActiveColor.Value;
|
||||
this._zoneInActiveColor = inactiveColor != string.Empty ? inactiveColor : "#F5FCFF";
|
||||
_zoneInActiveColor = inactiveColor != string.Empty ? inactiveColor : "#F5FCFF";
|
||||
|
||||
string borderColor = Settings.Properties.FancyzonesBorderColor.Value;
|
||||
this._zoneBorderColor = borderColor != string.Empty ? borderColor : "#FFFFFF";
|
||||
_zoneBorderColor = borderColor != string.Empty ? borderColor : "#FFFFFF";
|
||||
|
||||
string highlightColor = Settings.Properties.FancyzonesZoneHighlightColor.Value;
|
||||
this._zoneHighlightColor = highlightColor != string.Empty ? highlightColor : "#0078D7";
|
||||
_zoneHighlightColor = highlightColor != string.Empty ? highlightColor : "#0078D7";
|
||||
|
||||
GeneralSettings generalSettings;
|
||||
try
|
||||
@ -76,7 +76,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
SettingsUtils.SaveSettings(generalSettings.ToJsonString(), string.Empty);
|
||||
}
|
||||
|
||||
this._isEnabled = generalSettings.Enabled.FancyZones;
|
||||
_isEnabled = generalSettings.Enabled.FancyZones;
|
||||
}
|
||||
|
||||
private bool _isEnabled;
|
||||
|
@ -5,7 +5,6 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text.Json;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib.Utilities;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib.ViewModels.Commands;
|
||||
@ -20,7 +19,6 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
|
||||
public ButtonClickCommand RestartElevatedButtonEventHandler { get; set; }
|
||||
|
||||
|
||||
public Func<string, int> UpdateUIThemeCallBack { get; }
|
||||
|
||||
public Func<string, int> SendConfigMSG { get; }
|
||||
@ -29,16 +27,16 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
|
||||
public Func<string, int> SendCheckForUpdatesConfigMSG { get; }
|
||||
|
||||
public readonly string RunningAsUserDefaultText;
|
||||
public string RunningAsUserDefaultText { get; set; }
|
||||
|
||||
public readonly string RunningAsAdminDefaultText;
|
||||
public string RunningAsAdminDefaultText { get; set; }
|
||||
|
||||
public string SettingsConfigFileFolder = string.Empty;
|
||||
private string _settingsConfigFileFolder = string.Empty;
|
||||
|
||||
public GeneralViewModel(string runAsAdminText, string runAsUserText, bool isElevated, bool isAdmin, Func<string, int> updateTheme, Func<string, int> ipcMSGCallBackFunc, Func<string, int> ipcMSGRestartAsAdminMSGCallBackFunc, Func<string, int> ipcMSGCheckForUpdatesCallBackFunc, string configFileSubfolder = "")
|
||||
{
|
||||
this.CheckFoUpdatesEventHandler = new ButtonClickCommand(CheckForUpdates_Click);
|
||||
this.RestartElevatedButtonEventHandler = new ButtonClickCommand(Restart_Elevated);
|
||||
CheckFoUpdatesEventHandler = new ButtonClickCommand(CheckForUpdates_Click);
|
||||
RestartElevatedButtonEventHandler = new ButtonClickCommand(Restart_Elevated);
|
||||
|
||||
try
|
||||
{
|
||||
@ -72,7 +70,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
UpdateUIThemeCallBack(GeneralSettingsConfigs.Theme.ToLower());
|
||||
|
||||
// Update Settings file folder:
|
||||
SettingsConfigFileFolder = configFileSubfolder;
|
||||
_settingsConfigFileFolder = configFileSubfolder;
|
||||
|
||||
switch (GeneralSettingsConfigs.Theme.ToLower())
|
||||
{
|
||||
@ -341,9 +339,9 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
}
|
||||
|
||||
// callback function to launch the URL to check for updates.
|
||||
private async void CheckForUpdates_Click()
|
||||
private void CheckForUpdates_Click()
|
||||
{
|
||||
GeneralSettings settings = SettingsUtils.GetSettings<GeneralSettings>(SettingsConfigFileFolder);
|
||||
GeneralSettings settings = SettingsUtils.GetSettings<GeneralSettings>(_settingsConfigFileFolder);
|
||||
settings.CustomActionName = "check_for_updates";
|
||||
|
||||
OutGoingGeneralSettings outsettings = new OutGoingGeneralSettings(settings);
|
||||
@ -354,7 +352,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
|
||||
public void Restart_Elevated()
|
||||
{
|
||||
GeneralSettings settings = SettingsUtils.GetSettings<GeneralSettings>(SettingsConfigFileFolder);
|
||||
GeneralSettings settings = SettingsUtils.GetSettings<GeneralSettings>(_settingsConfigFileFolder);
|
||||
settings.CustomActionName = "restart_elevation";
|
||||
|
||||
OutGoingGeneralSettings outsettings = new OutGoingGeneralSettings(settings);
|
||||
|
@ -3,14 +3,10 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Windows.Input;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib.Helpers;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib.ViewModels.Commands;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
{
|
||||
@ -49,14 +45,14 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
// set the callback functions value to hangle outgoing IPC message.
|
||||
SendConfigMSG = ipcMSGCallBackFunc;
|
||||
|
||||
this._isEnabled = generalSettings.Enabled.ImageResizer;
|
||||
this._advancedSizes = Settings.Properties.ImageresizerSizes.Value;
|
||||
this._jpegQualityLevel = Settings.Properties.ImageresizerJpegQualityLevel.Value;
|
||||
this._pngInterlaceOption = Settings.Properties.ImageresizerPngInterlaceOption.Value;
|
||||
this._tiffCompressOption = Settings.Properties.ImageresizerTiffCompressOption.Value;
|
||||
this._fileName = Settings.Properties.ImageresizerFileName.Value;
|
||||
this._keepDateModified = Settings.Properties.ImageresizerKeepDateModified.Value;
|
||||
this._encoderGuidId = GetEncoderIndex(Settings.Properties.ImageresizerFallbackEncoder.Value);
|
||||
_isEnabled = generalSettings.Enabled.ImageResizer;
|
||||
_advancedSizes = Settings.Properties.ImageresizerSizes.Value;
|
||||
_jpegQualityLevel = Settings.Properties.ImageresizerJpegQualityLevel.Value;
|
||||
_pngInterlaceOption = Settings.Properties.ImageresizerPngInterlaceOption.Value;
|
||||
_tiffCompressOption = Settings.Properties.ImageresizerTiffCompressOption.Value;
|
||||
_fileName = Settings.Properties.ImageresizerFileName.Value;
|
||||
_keepDateModified = Settings.Properties.ImageresizerKeepDateModified.Value;
|
||||
_encoderGuidId = GetEncoderIndex(Settings.Properties.ImageresizerFallbackEncoder.Value);
|
||||
|
||||
int i = 0;
|
||||
foreach (ImageSize size in _advancedSizes)
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@ -26,13 +25,12 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
private const string ProfileFileMutexName = "PowerToys.KeyboardManager.ConfigMutex";
|
||||
private const int ProfileFileMutexWaitTimeoutMilliseconds = 1000;
|
||||
|
||||
private readonly FileSystemWatcher watcher;
|
||||
public KeyboardManagerSettings Settings { get; set; }
|
||||
|
||||
private ICommand remapKeyboardCommand;
|
||||
private ICommand editShortcutCommand;
|
||||
public KeyboardManagerSettings settings;
|
||||
private KeyboardManagerProfile profile;
|
||||
private GeneralSettings generalSettings;
|
||||
private ICommand _remapKeyboardCommand;
|
||||
private ICommand _editShortcutCommand;
|
||||
private KeyboardManagerProfile _profile;
|
||||
private GeneralSettings _generalSettings;
|
||||
|
||||
private Func<string, int> SendConfigMSG { get; }
|
||||
|
||||
@ -47,28 +45,28 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
if (SettingsUtils.SettingsExists(PowerToyName))
|
||||
{
|
||||
// Todo: Be more resilient while reading and saving settings.
|
||||
settings = SettingsUtils.GetSettings<KeyboardManagerSettings>(PowerToyName);
|
||||
Settings = SettingsUtils.GetSettings<KeyboardManagerSettings>(PowerToyName);
|
||||
|
||||
// Load profile.
|
||||
if (!LoadProfile())
|
||||
{
|
||||
profile = new KeyboardManagerProfile();
|
||||
_profile = new KeyboardManagerProfile();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
settings = new KeyboardManagerSettings(PowerToyName);
|
||||
SettingsUtils.SaveSettings(settings.ToJsonString(), PowerToyName);
|
||||
Settings = new KeyboardManagerSettings(PowerToyName);
|
||||
SettingsUtils.SaveSettings(Settings.ToJsonString(), PowerToyName);
|
||||
}
|
||||
|
||||
if (SettingsUtils.SettingsExists())
|
||||
{
|
||||
generalSettings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
||||
_generalSettings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
||||
}
|
||||
else
|
||||
{
|
||||
generalSettings = new GeneralSettings();
|
||||
SettingsUtils.SaveSettings(generalSettings.ToJsonString(), string.Empty);
|
||||
_generalSettings = new GeneralSettings();
|
||||
SettingsUtils.SaveSettings(_generalSettings.ToJsonString(), string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,16 +74,16 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
{
|
||||
get
|
||||
{
|
||||
return generalSettings.Enabled.KeyboardManager;
|
||||
return _generalSettings.Enabled.KeyboardManager;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (generalSettings.Enabled.KeyboardManager != value)
|
||||
if (_generalSettings.Enabled.KeyboardManager != value)
|
||||
{
|
||||
generalSettings.Enabled.KeyboardManager = value;
|
||||
_generalSettings.Enabled.KeyboardManager = value;
|
||||
OnPropertyChanged(nameof(Enabled));
|
||||
OutGoingGeneralSettings outgoing = new OutGoingGeneralSettings(generalSettings);
|
||||
OutGoingGeneralSettings outgoing = new OutGoingGeneralSettings(_generalSettings);
|
||||
|
||||
SendConfigMSG(outgoing.ToString());
|
||||
}
|
||||
@ -97,9 +95,9 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
{
|
||||
get
|
||||
{
|
||||
if (profile != null)
|
||||
if (_profile != null)
|
||||
{
|
||||
return profile.RemapKeys.InProcessRemapKeys;
|
||||
return _profile.RemapKeys.InProcessRemapKeys;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -117,9 +115,9 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
{
|
||||
get
|
||||
{
|
||||
if (profile != null)
|
||||
if (_profile != null)
|
||||
{
|
||||
return CombineShortcutLists(profile.RemapShortcuts.GlobalRemapShortcuts, profile.RemapShortcuts.AppSpecificRemapShortcuts);
|
||||
return CombineShortcutLists(_profile.RemapShortcuts.GlobalRemapShortcuts, _profile.RemapShortcuts.AppSpecificRemapShortcuts);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -128,9 +126,9 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand RemapKeyboardCommand => remapKeyboardCommand ?? (remapKeyboardCommand = new RelayCommand(OnRemapKeyboard));
|
||||
public ICommand RemapKeyboardCommand => _remapKeyboardCommand ?? (_remapKeyboardCommand = new RelayCommand(OnRemapKeyboard));
|
||||
|
||||
public ICommand EditShortcutCommand => editShortcutCommand ?? (editShortcutCommand = new RelayCommand(OnEditShortcut));
|
||||
public ICommand EditShortcutCommand => _editShortcutCommand ?? (_editShortcutCommand = new RelayCommand(OnEditShortcut));
|
||||
|
||||
private async void OnRemapKeyboard()
|
||||
{
|
||||
@ -175,8 +173,8 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
// update the UI element here.
|
||||
try
|
||||
{
|
||||
profile = SettingsUtils.GetSettings<KeyboardManagerProfile>(PowerToyName, settings.Properties.ActiveConfiguration.Value + JsonFileType);
|
||||
FilterRemapKeysList(profile.RemapKeys.InProcessRemapKeys);
|
||||
_profile = SettingsUtils.GetSettings<KeyboardManagerProfile>(PowerToyName, Settings.Properties.ActiveConfiguration.Value + JsonFileType);
|
||||
FilterRemapKeysList(_profile.RemapKeys.InProcessRemapKeys);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@ -198,6 +196,5 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,6 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib;
|
||||
using Microsoft.PowerToys.Settings.UI.Lib.Helpers;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
@ -17,12 +16,12 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
|
||||
private Func<string, int> SendConfigMSG { get; }
|
||||
|
||||
public string SettingsConfigFileFolder = string.Empty;
|
||||
private string _settingsConfigFileFolder = string.Empty;
|
||||
|
||||
public PowerPreviewViewModel(Func<string, int> ipcMSGCallBackFunc, string configFileSubfolder = "")
|
||||
{
|
||||
// Update Settings file folder:
|
||||
SettingsConfigFileFolder = configFileSubfolder;
|
||||
_settingsConfigFileFolder = configFileSubfolder;
|
||||
|
||||
try
|
||||
{
|
||||
@ -37,9 +36,9 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
// set the callback functions value to hangle outgoing IPC message.
|
||||
SendConfigMSG = ipcMSGCallBackFunc;
|
||||
|
||||
this._svgRenderIsEnabled = Settings.Properties.EnableSvgPreview;
|
||||
this._svgThumbnailIsEnabled = Settings.Properties.EnableSvgThumbnail;
|
||||
this._mdRenderIsEnabled = Settings.Properties.EnableMdPreview;
|
||||
_svgRenderIsEnabled = Settings.Properties.EnableSvgPreview;
|
||||
_svgThumbnailIsEnabled = Settings.Properties.EnableSvgThumbnail;
|
||||
_mdRenderIsEnabled = Settings.Properties.EnableMdPreview;
|
||||
}
|
||||
|
||||
private bool _svgRenderIsEnabled = false;
|
||||
@ -102,7 +101,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
|
||||
public string GetSettingsSubPath()
|
||||
{
|
||||
return SettingsConfigFileFolder + "\\" + ModuleName;
|
||||
return _settingsConfigFileFolder + "\\" + ModuleName;
|
||||
}
|
||||
|
||||
private void RaisePropertyChanged([CallerMemberName] string propertyName = null)
|
||||
|
@ -12,7 +12,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
{
|
||||
private const string ModuleName = "PowerRename";
|
||||
|
||||
public string SettingsConfigFileFolder = string.Empty;
|
||||
private string _settingsConfigFileFolder = string.Empty;
|
||||
|
||||
private PowerRenameSettings Settings { get; set; }
|
||||
|
||||
@ -21,7 +21,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
public PowerRenameViewModel(Func<string, int> ipcMSGCallBackFunc, string configFileSubfolder = "")
|
||||
{
|
||||
// Update Settings file folder:
|
||||
SettingsConfigFileFolder = configFileSubfolder;
|
||||
_settingsConfigFileFolder = configFileSubfolder;
|
||||
|
||||
try
|
||||
{
|
||||
@ -76,7 +76,6 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
{
|
||||
if (value != _powerRenameEnabled)
|
||||
{
|
||||
|
||||
GeneralSettings generalSettings = SettingsUtils.GetSettings<GeneralSettings>(string.Empty);
|
||||
generalSettings.Enabled.PowerRename = value;
|
||||
OutGoingGeneralSettings snd = new OutGoingGeneralSettings(generalSettings);
|
||||
@ -190,7 +189,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
|
||||
public string GetSettingsSubPath()
|
||||
{
|
||||
return SettingsConfigFileFolder + "\\" + ModuleName;
|
||||
return _settingsConfigFileFolder + "\\" + ModuleName;
|
||||
}
|
||||
|
||||
private void RaisePropertyChanged([CallerMemberName] string propertyName = null)
|
||||
|
@ -16,12 +16,12 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
|
||||
private Func<string, int> SendConfigMSG { get; }
|
||||
|
||||
public string SettingsConfigFileFolder = string.Empty;
|
||||
private string _settingsConfigFileFolder = string.Empty;
|
||||
|
||||
public ShortcutGuideViewModel(Func<string, int> ipcMSGCallBackFunc, string configFileSubfolder = "")
|
||||
{
|
||||
// Update Settings file folder:
|
||||
SettingsConfigFileFolder = configFileSubfolder;
|
||||
_settingsConfigFileFolder = configFileSubfolder;
|
||||
|
||||
try
|
||||
{
|
||||
@ -48,9 +48,9 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
// set the callback functions value to hangle outgoing IPC message.
|
||||
SendConfigMSG = ipcMSGCallBackFunc;
|
||||
|
||||
this._isEnabled = generalSettings.Enabled.ShortcutGuide;
|
||||
this._pressTime = Settings.Properties.PressTime.Value;
|
||||
this._opacity = Settings.Properties.OverlayOpacity.Value;
|
||||
_isEnabled = generalSettings.Enabled.ShortcutGuide;
|
||||
_pressTime = Settings.Properties.PressTime.Value;
|
||||
_opacity = Settings.Properties.OverlayOpacity.Value;
|
||||
|
||||
string theme = Settings.Properties.Theme.Value;
|
||||
|
||||
@ -172,7 +172,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
|
||||
|
||||
public string GetSettingsSubPath()
|
||||
{
|
||||
return SettingsConfigFileFolder + "\\" + ModuleName;
|
||||
return _settingsConfigFileFolder + "\\" + ModuleName;
|
||||
}
|
||||
|
||||
public void RaisePropertyChanged([CallerMemberName] string propertyName = null)
|
||||
|
@ -25,6 +25,7 @@
|
||||
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
|
||||
<!-- crutkas TODO: added for fallback, may need to be removed for WinUI3 -->
|
||||
<AssetTargetFallback>uap10.0.18362</AssetTargetFallback>
|
||||
|
@ -2,10 +2,9 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
<Platforms>x64</Platforms>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
|
@ -55,7 +55,7 @@ namespace ViewModelTests
|
||||
Func<string, int> SendMockIPCConfigMSG = msg =>
|
||||
{
|
||||
SndModuleSettings<SndPowerPreviewSettings> snd = JsonSerializer.Deserialize<SndModuleSettings<SndPowerPreviewSettings>>(msg);
|
||||
Assert.IsTrue(snd.powertoys.FileExplorerPreviewSettings.Properties.EnableSvgPreview);
|
||||
Assert.IsTrue(snd.PowertoysSetting.FileExplorerPreviewSettings.Properties.EnableSvgPreview);
|
||||
return 0;
|
||||
};
|
||||
|
||||
@ -73,7 +73,7 @@ namespace ViewModelTests
|
||||
Func<string, int> SendMockIPCConfigMSG = msg =>
|
||||
{
|
||||
SndModuleSettings<SndPowerPreviewSettings> snd = JsonSerializer.Deserialize<SndModuleSettings<SndPowerPreviewSettings>>(msg);
|
||||
Assert.IsTrue(snd.powertoys.FileExplorerPreviewSettings.Properties.EnableSvgThumbnail);
|
||||
Assert.IsTrue(snd.PowertoysSetting.FileExplorerPreviewSettings.Properties.EnableSvgThumbnail);
|
||||
return 0;
|
||||
};
|
||||
|
||||
@ -91,7 +91,7 @@ namespace ViewModelTests
|
||||
Func<string, int> SendMockIPCConfigMSG = msg =>
|
||||
{
|
||||
SndModuleSettings<SndPowerPreviewSettings> snd = JsonSerializer.Deserialize<SndModuleSettings<SndPowerPreviewSettings>>(msg);
|
||||
Assert.IsTrue(snd.powertoys.FileExplorerPreviewSettings.Properties.EnableMdPreview);
|
||||
Assert.IsTrue(snd.PowertoysSetting.FileExplorerPreviewSettings.Properties.EnableMdPreview);
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
<AssemblyCompany>Microsoft Corp.</AssemblyCompany>
|
||||
<AssemblyCopyright>Copyright (C) 2020 Microsoft Corp.</AssemblyCopyright>
|
||||
<AssemblyProduct>PowerToys</AssemblyProduct>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<AssemblyVersionFiles Include="Generated Files\AssemblyInfo.cs" />
|
||||
@ -297,6 +298,12 @@
|
||||
<EnableTypeInfoReflection>false</EnableTypeInfoReflection>
|
||||
<EnableXBindDiagnostics>false</EnableXBindDiagnostics>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|Win32'">
|
||||
<LangVersion>8.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|Win32'">
|
||||
<LangVersion>8.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
@ -13,7 +13,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
|
||||
public FancyZonesPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
InitializeComponent();
|
||||
ViewModel = new FancyZonesViewModel(ShellPage.SendDefaultIPCMessage);
|
||||
DataContext = ViewModel;
|
||||
}
|
||||
|
@ -25,12 +25,12 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
/// </summary>
|
||||
public GeneralPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
InitializeComponent();
|
||||
|
||||
// Load string resources
|
||||
ResourceLoader loader = ResourceLoader.GetForViewIndependentUse();
|
||||
|
||||
this.ViewModel = new GeneralViewModel(
|
||||
ViewModel = new GeneralViewModel(
|
||||
loader.GetString("GeneralSettings_RunningAsAdminText"),
|
||||
loader.GetString("GeneralSettings_RunningAsUserText"),
|
||||
ShellPage.IsElevated,
|
||||
|
@ -2,9 +2,7 @@
|
||||
// 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 Microsoft.PowerToys.Settings.UI.Lib.ViewModels;
|
||||
using Windows.UI.Popups;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
@ -30,7 +28,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
int rowNum = int.Parse(deleteRowButton.CommandParameter.ToString());
|
||||
ViewModel.DeleteImageSize(rowNum);
|
||||
}
|
||||
catch (Exception exp)
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -41,7 +39,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
ViewModel.AddRow();
|
||||
}
|
||||
catch (Exception exp)
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
|
||||
watcher = Helper.GetFileWatcher(
|
||||
PowerToyName,
|
||||
ViewModel.settings.Properties.ActiveConfiguration.Value + ".json",
|
||||
ViewModel.Settings.Properties.ActiveConfiguration.Value + ".json",
|
||||
OnConfigFileUpdate);
|
||||
|
||||
InitializeComponent();
|
||||
|
@ -12,13 +12,13 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
/// </summary>
|
||||
public sealed partial class PowerPreviewPage : Page
|
||||
{
|
||||
public PowerPreviewViewModel viewModel { get; set; }
|
||||
public PowerPreviewViewModel ViewModel { get; set; }
|
||||
|
||||
public PowerPreviewPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
viewModel = new PowerPreviewViewModel(ShellPage.SendDefaultIPCMessage);
|
||||
DataContext = viewModel;
|
||||
InitializeComponent();
|
||||
ViewModel = new PowerPreviewViewModel(ShellPage.SendDefaultIPCMessage);
|
||||
DataContext = ViewModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
|
||||
public PowerRenamePage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
InitializeComponent();
|
||||
ViewModel = new PowerRenameViewModel(ShellPage.SendDefaultIPCMessage);
|
||||
|
||||
DataContext = ViewModel;
|
||||
|
Loading…
Reference in New Issue
Block a user