1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 //----------------------------------------------------------------
4 namespace System.Activities.Presentation.Internal.PropertyEditing.Metadata
7 using System.Collections.Generic;
8 using System.ComponentModel;
9 using System.Diagnostics;
10 using System.Diagnostics.CodeAnalysis;
12 using System.Windows.Controls;
13 using System.Windows.Input;
14 using System.Windows.Media.Effects;
16 using System.Activities.Presentation.Metadata;
17 using System.Activities.Presentation.PropertyEditing;
19 using System.Activities.Presentation.Internal.PropertyEditing.Editors;
22 // Metadata specific to PropertyEditing -- associates specific PropertyValueEditors with
23 // specific property Types or properties themselves.
25 [SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes", Justification = "Suppress to avoid churning the code base.")]
26 static class PropertyInspectorMetadata
29 private static bool _initialized;
32 // Initializes the metadata provided by this class. Multiple class
35 public static void Initialize()
42 // Introduce any Cider-specific customizations
43 AttributeTableBuilder builder = new AttributeTableBuilder();
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.
52 MakeBasic(builder, typeof(FrameworkElement), FrameworkElement.FlowDirectionProperty);
53 MakeBasic(builder, typeof(Control), Control.NameProperty);
55 // Note: Add any new attributes here or into System.Activities.Presentation.Developer /
56 // System.Activities.Presentation.Internal.Metadata.BaseOverridesAttributeTable
58 MetadataStore.AddAttributeTable(builder.CreateTable());
63 private static void MakeBasic(AttributeTableBuilder builder, Type owningType, DependencyProperty property)
65 builder.AddCustomAttributes(owningType, property, BrowsableAttribute.Yes);
66 builder.AddCustomAttributes(owningType, property, new EditorBrowsableAttribute(EditorBrowsableState.Always));