1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 //----------------------------------------------------------------
4 namespace System.Activities.Presentation.Internal.PropertyEditing.Automation
7 using System.Diagnostics.CodeAnalysis;
8 using System.Windows.Controls;
9 using System.Windows.Automation.Peers;
12 // Standard ListBox. However, it uses AutomatedListBoxItemAutomationPeer to represent
13 // all items within it, which is our class and which allows us to return user-friendly
14 // representation of all Cider structures exposed through automation.
16 [SuppressMessage("Microsoft.Maintainability", "CA1501:AvoidExcessiveInheritance")]
17 internal class AutomatedListBox : ListBox
20 protected override AutomationPeer OnCreateAutomationPeer()
22 return new AutomatedListBoxAutomationPeer(this);
25 private class AutomatedListBoxAutomationPeer : ListBoxAutomationPeer
27 public AutomatedListBoxAutomationPeer(ListBox owner)
32 protected override ItemAutomationPeer CreateItemAutomationPeer(object item)
34 return new AutomatedListBoxItemAutomationPeer(item, this);