/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/powerdisplay/PowerDisplay.Cli/Commands/SetCommand.cs
32 строки
1020 B
moooyo
feat(powerdisplay): add CLI for monitor control (#48632)
16 июл 2026, 18:08
Не верифицирован
16 июл 2026, 18:08
5c9c93d
Код
Авторство
О чём код?
// 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.Linq; namespace PowerDisplay.Cli.Commands; public static class SetCommand { /// <summary> /// Counts how many settings are specified in <paramref name="inputs"/>. /// Exactly one must be non-null for a valid <c>set</c> invocation. /// </summary> public static int CountSelectedSettings(SetCommandInputs inputs) { // A continuous int? of 0 still boxes to a non-null object, so zero-valued // settings are counted just like the discrete string settings. object?[] settings = [ inputs.Brightness, inputs.Contrast, inputs.Volume, inputs.ColorTemperature, inputs.InputSource, inputs.PowerState, inputs.Orientation, ]; return settings.Count(s => s is not null); } }