mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
* [Dev][Build] .NET 8 Upgrade Silenced errors first fix. * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1859 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1854. * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1860 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1861 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1862 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1863 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1864 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1865 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA2208 * [Dev][Build] .NET 8 Upgrade Silenced errors. CS9191 * [Dev][Build] .NET 8 Upgrade Silenced errors. Spell check * [Dev][Build] .NET 8 Upgrade Silenced errors. Spell check * [Dev][Build] .NET 8 Upgrade Silenced errors. - CompositeFormat variables used more than once in the same file were assigned to a single variable. - GetProcessesByName logic fix. - String comparion fix. - ArgumentOutOfRangeException message change. * [Dev][Build] .NET 8 Upgrade Silenced errors. - Null check added. - static readonly CompositeFormat added for all fields.
46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
// 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.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Library
|
|
{
|
|
public class EnvironmentVariablesSettings : BasePTModuleSettings, ISettingsConfig
|
|
{
|
|
public const string ModuleName = "EnvironmentVariables";
|
|
|
|
private static readonly JsonSerializerOptions _serializerOptions = new JsonSerializerOptions
|
|
{
|
|
WriteIndented = true,
|
|
};
|
|
|
|
[JsonPropertyName("properties")]
|
|
public EnvironmentVariablesProperties Properties { get; set; }
|
|
|
|
public EnvironmentVariablesSettings()
|
|
{
|
|
Properties = new EnvironmentVariablesProperties();
|
|
Version = "1.0";
|
|
Name = ModuleName;
|
|
}
|
|
|
|
public virtual void Save(ISettingsUtils settingsUtils)
|
|
{
|
|
// Save settings to file
|
|
var options = _serializerOptions;
|
|
|
|
ArgumentNullException.ThrowIfNull(settingsUtils);
|
|
|
|
settingsUtils.SaveSettings(JsonSerializer.Serialize(this, options), ModuleName);
|
|
}
|
|
|
|
public string GetModuleName() => Name;
|
|
|
|
public bool UpgradeSettingsConfiguration() => false;
|
|
}
|
|
}
|