/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/EnvironmentVariables/EnvironmentVariablesUILib/Converters/EnvironmentStateToMessageConverter.cs
34 строки
1 KB
Dave Rayment
[EnvironmentVariables] Validation fixes, centralised validation, error message improvements (#46837)
05 авг 2026, 11:42
Не верифицирован
05 авг 2026, 11:42
3079a3c
Код
Авторство
О чём код?
// 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 EnvironmentVariablesUILib.Helpers; using EnvironmentVariablesUILib.Models; using Microsoft.UI.Xaml.Data; namespace EnvironmentVariablesUILib.Converters; public partial class EnvironmentStateToMessageConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { var resourceLoader = ResourceLoaderInstance.ResourceLoader; var type = (EnvironmentState)value; return type switch { EnvironmentState.Unchanged => string.Empty, EnvironmentState.ChangedOnStartup => resourceLoader.GetString("StateNotUpToDateOnStartupMsg"), EnvironmentState.EnvironmentMessageReceived => resourceLoader.GetString("StateNotUpToDateEnvironmentMessageReceivedMsg"), EnvironmentState.ProfileNotApplicable => resourceLoader.GetString("StateProfileNotApplicableMsg"), EnvironmentState.ProfileNameInvalid => resourceLoader.GetString("StateProfileNameInvalidMsg"), _ => throw new NotImplementedException(), }; } public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } }