[corlib] Update ValueTuple implementation
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Base / Core / Internal / PropertyEditing / Metadata / PropertyInspectorMetadata.cs
1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //----------------------------------------------------------------
4 namespace System.Activities.Presentation.Internal.PropertyEditing.Metadata 
5 {
6     using System;
7     using System.Collections.Generic;
8     using System.ComponentModel;
9     using System.Diagnostics;
10     using System.Diagnostics.CodeAnalysis;
11     using System.Windows;
12     using System.Windows.Controls;
13     using System.Windows.Input;
14     using System.Windows.Media.Effects;
15
16     using System.Activities.Presentation.Metadata;
17     using System.Activities.Presentation.PropertyEditing;
18
19     using System.Activities.Presentation.Internal.PropertyEditing.Editors;
20
21     // <summary>
22     // Metadata specific to PropertyEditing -- associates specific PropertyValueEditors with
23     // specific property Types or properties themselves.
24     // </summary>
25     [SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes", Justification = "Suppress to avoid churning the code base.")]
26     static class PropertyInspectorMetadata 
27     {
28
29         private static bool _initialized;
30
31         // <summary>
32         // Initializes the metadata provided by this class.  Multiple class
33         // are ignored.
34         // </summary>
35         public static void Initialize() 
36         {
37             if (_initialized)
38             {
39                 return;
40             }
41
42             // Introduce any Cider-specific customizations
43             AttributeTableBuilder builder = new AttributeTableBuilder();
44
45             // Make Name and FlowDirection properties browsable.  The reason why
46             // these attributes are here instead of in the BaseOverridesAttributeTable
47             // is because the BaseAttributeTable explicitly hides these properties
48             // and adding conflicting attributes to the same table (via BaseOverridesAttributeTable
49             // which derives from BaseAttributeTable) currently results in unspeciefied
50             // behavior.  Hence we use this table to deal with these attributes.
51             //
52             MakeBasic(builder, typeof(FrameworkElement), FrameworkElement.FlowDirectionProperty);
53             MakeBasic(builder, typeof(Control), Control.NameProperty);
54
55             // Note: Add any new attributes here or into System.Activities.Presentation.Developer / 
56             // System.Activities.Presentation.Internal.Metadata.BaseOverridesAttributeTable
57
58             MetadataStore.AddAttributeTable(builder.CreateTable());
59
60             _initialized = true;
61         }
62
63         private static void MakeBasic(AttributeTableBuilder builder, Type owningType, DependencyProperty property) 
64         {
65             builder.AddCustomAttributes(owningType, property, BrowsableAttribute.Yes);
66             builder.AddCustomAttributes(owningType, property, new EditorBrowsableAttribute(EditorBrowsableState.Always));
67         }
68
69     }
70 }