[runtime] Fix corlib out of date error with disabled COM
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Base / Core / Internal / PropertyEditing / FromExpression / Framework / PropertyInspector / IPropertyInspector.cs
1 // -------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All Rights Reserved.
3 // -------------------------------------------------------------------
4 //From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties
5 namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector
6 {
7     using System;
8     using System.Collections.Generic;
9     using System.Windows;
10     using System.Activities.Presentation.PropertyEditing;
11     using System.Diagnostics;
12     using System.Activities.Presentation;
13
14     internal interface IPropertyInspector
15     {
16         bool IsCategoryExpanded(string categoryName);
17
18         // <summary>
19         // Calls Update on the current transaction, if one exists within the context
20         // of this PropertyInspector
21         // </summary>
22         void UpdateTransaction();
23     }
24
25     internal class PropertyInspectorHelper
26     {
27         // OwningPropertyInspector Attached, Inherited DP
28         public static readonly DependencyProperty OwningPropertyInspectorModelProperty = DependencyProperty.RegisterAttached("OwningPropertyInspectorModel", typeof(IPropertyInspector), typeof(PropertyInspectorHelper), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
29         public static readonly DependencyProperty OwningPropertyInspectorElementProperty = DependencyProperty.RegisterAttached("OwningPropertyInspectorElement", typeof(UIElement), typeof(PropertyInspectorHelper), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
30
31         // <summary>
32         // Writes the attached property OwningPropertyInspector to the given element.
33         // </summary>
34         // <param name="d">The element to which to write the attached property.</param>
35         // <param name="value">The property value to set</param>
36         public static void SetOwningPropertyInspectorModel(DependencyObject dependencyObject, IPropertyInspector value)
37         {
38             if (dependencyObject == null)
39             {
40                 throw FxTrace.Exception.ArgumentNull("dependencyObject");
41             }
42             dependencyObject.SetValue(PropertyInspectorHelper.OwningPropertyInspectorModelProperty, value);
43         }
44
45         // <summary>
46         // Reads the attached property OwningPropertyInspector from the given element.
47         // </summary>
48         // <param name="d">The element from which to read the attached property.</param>
49         // <returns>The property's value.</returns>
50         public static IPropertyInspector GetOwningPropertyInspectorModel(DependencyObject dependencyObject)
51         {
52             if (dependencyObject == null)
53             {
54                 throw FxTrace.Exception.ArgumentNull("dependencyObject");
55             }
56             return (IPropertyInspector)dependencyObject.GetValue(PropertyInspectorHelper.OwningPropertyInspectorModelProperty);
57         }
58
59         // OwningPropertyInspector Attached, Inherited DP
60
61         // <summary>
62         // Writes the attached property OwningPropertyInspector to the given element.
63         // </summary>
64         // <param name="d">The element to which to write the attached property.</param>
65         // <param name="value">The property value to set</param>
66         public static void SetOwningPropertyInspectorElement(DependencyObject dependencyObject, UIElement value)
67         {
68             if (dependencyObject == null)
69             {
70                 throw FxTrace.Exception.ArgumentNull("dependencyObject");
71             }
72             dependencyObject.SetValue(PropertyInspectorHelper.OwningPropertyInspectorElementProperty, value);
73         }
74
75         // <summary>
76         // Reads the attached property OwningPropertyInspector from the given element.
77         // </summary>
78         // <param name="d">The element from which to read the attached property.</param>
79         // <returns>The property's value.</returns>
80         public static UIElement GetOwningPropertyInspectorElement(DependencyObject dependencyObject)
81         {
82             if (dependencyObject == null)
83             {
84                 throw FxTrace.Exception.ArgumentNull("dependencyObject");
85             }
86             return (UIElement)dependencyObject.GetValue(PropertyInspectorHelper.OwningPropertyInspectorElementProperty);
87         }
88     }
89 }
90