[Chore] Run solution code cleanup (#20584)

This commit is contained in:
Andrey Nekrasov
2022-09-16 11:54:58 +03:00
committed by GitHub
parent 09f4dead7f
commit ca3c758046
133 changed files with 108 additions and 359 deletions

View File

@@ -38,14 +38,12 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public ColorPickerActivationAction ActivationAction { get; set; }
[JsonPropertyName("colorhistory")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "Need to change this collection")]
public List<string> ColorHistory { get; set; }
[JsonPropertyName("colorhistorylimit")]
public int ColorHistoryLimit { get; set; }
[JsonPropertyName("visiblecolorformats")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "Need to change this collection")]
public Dictionary<string, bool> VisibleColorFormats { get; set; }
[JsonPropertyName("showcolorname")]

View File

@@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;

View File

@@ -136,8 +136,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library
case 40: // The Down Arrow key or button.
case 37: // The Left Arrow key or button.
case 39: // The Right Arrow key or button.
// case 8: // The Back key or button.
// case 13: // The Enter key or button.
// case 8: // The Back key or button.
// case 13: // The Enter key or button.
shortcutList.Add(Code);
break;
default:

View File

@@ -14,9 +14,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
// deserialization with System.Text.Json. This affects the UI display.
// See: https://github.com/dotnet/runtime/issues/30258
[JsonPropertyName("value")]
#pragma warning disable CA2227 // Collection properties should be read only
public ObservableCollection<ImageSize> Value { get; set; }
#pragma warning restore CA2227 // Collection properties should be read only
public ImageResizerSizes()
{

View File

@@ -2,10 +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.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.PowerToys.Settings.UI.Library.Enumerations;
namespace Microsoft.PowerToys.Settings.UI.Library
{

View File

@@ -2,8 +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.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;

View File

@@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using System.Text.Json.Serialization;
using ManagedCommon;
using Microsoft.PowerToys.Settings.UI.Library.Enumerations;
namespace Microsoft.PowerToys.Settings.UI.Library

View File

@@ -14,9 +14,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
// deserialization with System.Text.Json. This affects the UI display.
// See: https://github.com/dotnet/runtime/issues/30258
[JsonPropertyName("inProcess")]
#pragma warning disable CA2227 // Collection properties should be read only
public List<KeysDataModel> InProcessRemapKeys { get; set; }
#pragma warning restore CA2227 // Collection properties should be read only
public RemapKeysDataModel()
{

View File

@@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.IO.Abstractions;
using System.Text.Json;

View File

@@ -14,14 +14,10 @@ namespace Microsoft.PowerToys.Settings.UI.Library
// deserialization with System.Text.Json. This affects the UI display.
// See: https://github.com/dotnet/runtime/issues/30258
[JsonPropertyName("global")]
#pragma warning disable CA2227 // Collection properties should be read only
public List<KeysDataModel> GlobalRemapShortcuts { get; set; }
#pragma warning restore CA2227 // Collection properties should be read only
[JsonPropertyName("appSpecific")]
#pragma warning disable CA2227 // Collection properties should be read only
public List<AppSpecificKeysDataModel> AppSpecificRemapShortcuts { get; set; }
#pragma warning restore CA2227 // Collection properties should be read only
public ShortcutsKeyDataModel()
{

View File

@@ -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;

View File

@@ -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;
using System.Text.Json;
using System.Text.Json.Serialization;

View File

@@ -3,9 +3,7 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
namespace Microsoft.PowerToys.Settings.UI.Library.Utilities
{

View File

@@ -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;
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;

View File

@@ -5,7 +5,6 @@
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using Microsoft.PowerToys.Settings.UI.Library.Helpers;

View File

@@ -5,7 +5,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;

View File

@@ -3,14 +3,9 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text.Json;
using System.Timers;
using Microsoft.PowerToys.Settings.UI.Library.Enumerations;
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;

View File

@@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.CompilerServices;
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
@@ -89,14 +88,14 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
{
if (value != _powerRenameEnabled)
{
GeneralSettingsConfig.Enabled.PowerRename = value;
OutGoingGeneralSettings snd = new OutGoingGeneralSettings(GeneralSettingsConfig);
GeneralSettingsConfig.Enabled.PowerRename = value;
OutGoingGeneralSettings snd = new OutGoingGeneralSettings(GeneralSettingsConfig);
SendConfigMSG(snd.ToString());
SendConfigMSG(snd.ToString());
_powerRenameEnabled = value;
OnPropertyChanged(nameof(IsEnabled));
RaisePropertyChanged(nameof(GlobalAndMruEnabled));
_powerRenameEnabled = value;
OnPropertyChanged(nameof(IsEnabled));
RaisePropertyChanged(nameof(GlobalAndMruEnabled));
}
}
}

View File

@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -400,9 +399,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
return _settingsConfigFileFolder + "\\" + ModuleName;
}
#pragma warning disable CA1030 // Use events where appropriate
public void RaisePropertyChanged([CallerMemberName] string propertyName = null)
#pragma warning restore CA1030 // Use events where appropriate
{
OnPropertyChanged(propertyName);
SndVideoConferenceSettings outsettings = new SndVideoConferenceSettings(Settings);