Merge pull request #2408 from tastywheattasteslikechicken/MoreInterfaceSupport
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Base / Core / Internal / PropertyEditing / FromExpression / Diagnostics / AutomationId.cs
1 // -------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All Rights Reserved.
3 // -------------------------------------------------------------------
4
5 //Cider comment
6 //  This is used by PropertInspector\CategoryContainer.xaml 
7 //  For example automation:AutomationElement.Id="CategoryCheckBox"
8 //  I'm not sure that this is actually necessary 
9 //  But by including this we minimize the changes to CategoryContainer.xaml
10
11 //From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Diagnostics
12 namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Diagnostics.Automation
13 {
14     using System;
15     using System.Windows;
16     using System.Activities.Presentation;
17
18     // <summary>
19     // This DP is intended to be used in XAML property binding scenarios since FrameworkElement.Name is no longer available.
20     // </summary>
21     internal static class AutomationElement
22     {
23         public static readonly DependencyProperty IdProperty = DependencyProperty.RegisterAttached("Id", typeof(string), typeof(AutomationElement));
24
25         public static string GetId(DependencyObject o)
26         {
27             if (o == null)
28             {
29                 throw FxTrace.Exception.ArgumentNull("o");
30             }
31
32             return (string)o.GetValue(AutomationElement.IdProperty);
33         }
34
35         public static void SetId(DependencyObject o, string val)
36         {
37             if (o == null)
38             {
39                 throw FxTrace.Exception.ArgumentNull("o");
40             }
41
42             o.SetValue(AutomationElement.IdProperty, val);
43         }
44     }
45 }