[reflection] Coop handles icalls in System.Reflection and System.RuntimeTypeHandle...
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Base / Core / Internal / PropertyEditing / Automation / AutomatedListBox.cs
1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //----------------------------------------------------------------
4 namespace System.Activities.Presentation.Internal.PropertyEditing.Automation 
5 {
6     using System;
7     using System.Diagnostics.CodeAnalysis;
8     using System.Windows.Controls;
9     using System.Windows.Automation.Peers;
10
11     // <summary>
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.
15     // </summary>
16     [SuppressMessage("Microsoft.Maintainability", "CA1501:AvoidExcessiveInheritance")]
17     internal class AutomatedListBox : ListBox 
18     {
19
20         protected override AutomationPeer OnCreateAutomationPeer() 
21         {
22             return new AutomatedListBoxAutomationPeer(this);
23         }
24
25         private class AutomatedListBoxAutomationPeer : ListBoxAutomationPeer 
26         {
27             public AutomatedListBoxAutomationPeer(ListBox owner)
28                 : base(owner) 
29             {
30             }
31
32             protected override ItemAutomationPeer CreateItemAutomationPeer(object item) 
33             {
34                 return new AutomatedListBoxItemAutomationPeer(item, this);
35             }
36         }
37     }
38 }