/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/launcher/PowerLauncher/CustomSearchBox.cs
40 строк
1 KB
Davide Giacometti
[Build] Upgraded NetAnalyzers to 7.0.1 (#24792)
16 мар 2023, 17:51
Не верифицирован
16 мар 2023, 17:51
5cbe9dd
Код
Авторство
О чём код?
// 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.Windows; using System.Windows.Automation.Peers; using System.Windows.Controls; namespace PowerLauncher { public sealed class CustomSearchBox : TextBox { public List<UIElement> ControlledElements { get; } = new List<UIElement>(); protected override AutomationPeer OnCreateAutomationPeer() { return new AutoSuggestTextBoxAutomationPeer(this); } internal sealed class AutoSuggestTextBoxAutomationPeer : TextBoxAutomationPeer { public AutoSuggestTextBoxAutomationPeer(CustomSearchBox owner) : base(owner) { } protected override List<AutomationPeer> GetControlledPeersCore() { var controlledPeers = new List<AutomationPeer>(); foreach (UIElement controlledElement in ((CustomSearchBox)Owner).ControlledElements) { controlledPeers.Add(UIElementAutomationPeer.CreatePeerForElement(controlledElement)); } return controlledPeers; } } } }