/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/settings-ui/Settings.UI.Library/Helpers/SearchLocationLoader.cs
28 строк
1 KB
Jaylyn Barbee
[New Module] Light Switch (#41987)
06 окт 2025, 23:44
Не верифицирован
06 окт 2025, 23:44
0d52205
Код
Авторство
О чём код?
// 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.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using System.Text; using Settings.UI.Library.Helpers; namespace Microsoft.PowerToys.Settings.UI.Helpers { public static class SearchLocationLoader { private static readonly List<SearchLocation> LocationDataList = new List<SearchLocation>(); public static IEnumerable<SearchLocation> GetAll() { return LocationDataList .GroupBy(l => $"{l.Country}|{l.City}|{l.Latitude.ToString(CultureInfo.InvariantCulture)}|{l.Longitude.ToString(CultureInfo.InvariantCulture)}") .Select(g => g.First()) .OrderBy(l => l.Country, StringComparer.OrdinalIgnoreCase) .ThenBy(l => l.City, StringComparer.OrdinalIgnoreCase); } } }