mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
* upgraded NetAnalyzers to 7.0.1 * fix spellcheck * Microsoft.CodeAnalysis.NetAnalyzers 7.0.1 * rebase and fix
41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
// 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;
|
|
}
|
|
}
|
|
}
|
|
}
|