/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.RemoteDesktop/Helper/ConnectionHelpers.cs
30 строк
1 KB
Michael Jolley
CmdPal: New Remote Desktop built-in extension (#43090)
29 ноя 2025, 22:07
Не верифицирован
29 ноя 2025, 22:07
06afe09
Код
Авторство
О чём код?
// 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.Collections.Generic; using System.Linq; using Microsoft.CmdPal.Ext.RemoteDesktop.Commands; using Microsoft.CommandPalette.Extensions.Toolkit; namespace Microsoft.CmdPal.Ext.RemoteDesktop.Helper; internal static class ConnectionHelpers { public static ConnectionListItem MapToResult(string item) => new(item); public static ConnectionListItem? FindConnection(string query, IEnumerable<ConnectionListItem> connections) { if (string.IsNullOrWhiteSpace(query)) { return null; } var matchedConnection = ListHelpers.FilterList( connections, query, (s, i) => ListHelpers.ScoreListItem(s, i)) .FirstOrDefault(); return matchedConnection; } }