1 //----------------------------------------------------------------
2 // <copyright company="Microsoft Corporation">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //----------------------------------------------------------------
7 namespace System.Activities.Presentation
9 using System.Activities.Presentation.Metadata;
10 using System.Activities.Statements;
11 using System.ComponentModel;
12 using System.ServiceModel.Activities;
14 internal static class TargetFrameworkPropertyFilter
16 // Ideally we need to filter out ALL new properties introduced in 4.5, for performance
17 // reasons, we do not take this approach. Instead, we build a cache for the new properties
18 // we want to filter out. Currently the cache is not a full cache, it only contains new properties
19 // that affect activities.
20 // Ideally, the cache would only contain TypeName and we load type using TypeName.
21 // The current implementation of the cache directly references the type defined in S.A.dll and
22 // S.SM.A.dll, this is also to save performance cost of resolving the type by type name.
23 public static void FilterOut45Properties()
25 AttributeTableBuilder builder = new AttributeTableBuilder();
27 // System.Activities.dll
28 builder.AddCustomAttributes(typeof(ActivityBuilder), "ImplementationVersion", BrowsableAttribute.No);
29 builder.AddCustomAttributes(typeof(ActivityBuilder<>), "ImplementationVersion", BrowsableAttribute.No);
30 builder.AddCustomAttributes(typeof(DynamicActivity), "ImplementationVersion", BrowsableAttribute.No);
31 builder.AddCustomAttributes(typeof(DynamicActivity<>), "ImplementationVersion", BrowsableAttribute.No);
32 builder.AddCustomAttributes(typeof(Flowchart), "ValidateUnconnectedNodes", BrowsableAttribute.No);
33 builder.AddCustomAttributes(typeof(FlowDecision), "DisplayName", BrowsableAttribute.No);
34 builder.AddCustomAttributes(typeof(FlowSwitch<>), "DisplayName", BrowsableAttribute.No);
36 // System.ServiceModel.Activities.dll
37 builder.AddCustomAttributes(typeof(WorkflowService), "DefinitionIdentity", BrowsableAttribute.No);
38 builder.AddCustomAttributes(typeof(WorkflowService), "ImplementedContracts", BrowsableAttribute.No);
39 builder.AddCustomAttributes(typeof(Send), "SecurityTokenHandle", BrowsableAttribute.No);
41 MetadataStore.AddAttributeTable(builder.CreateTable());