Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / DesignerMetadata.cs / 1305376 / DesignerMetadata.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation { using System.ComponentModel; using System.Activities.Presentation.PropertyEditing; using System.Activities.Presentation.Metadata; using System.Activities.Presentation.View; using System.Activities.Presentation.Xaml; using System.Xaml.Schema; using System.Reflection; using System.Xaml; using System.Xml.Linq; class DesignerMetadata : IRegisterMetadata { // Called by the designer to register design-time metadata. public void Register() { AttributeTableBuilder builder = new AttributeTableBuilder(); // Register Designers. builder.AddCustomAttributes(typeof(Activity), new DesignerAttribute(typeof(ActivityDesigner))); builder.AddCustomAttributes(typeof(ActivityBuilder), new DesignerAttribute(typeof(ActivityTypeDesigner))); // Register PropertyValueEditors builder.AddCustomAttributes(typeof(Argument), new EditorAttribute(typeof(ExpressionValueEditor), typeof(PropertyValueEditor))); builder.AddCustomAttributes(typeof(Type), PropertyValueEditor.CreateEditorAttribute(typeof(TypePropertyEditor))); builder.AddCustomAttributes(typeof(Activity<>), new EditorAttribute(typeof(ExpressionValueEditor), typeof(PropertyValueEditor))); // Disable reuse of propertyvalueeditors for Arguments builder.AddCustomAttributes(typeof(Argument), new EditorReuseAttribute(false)); builder.AddCustomAttributes(typeof(Activity<>), new EditorReuseAttribute(false)); //Removing all the properties except "Name" from property grid for the type SchemaType. foreach (MemberInfo mi in typeof(ActivityBuilder).GetMembers()) { if (mi.MemberType == MemberTypes.Property && !mi.Name.Equals("Name")) { builder.AddCustomAttributes(typeof(ActivityBuilder), mi, new BrowsableAttribute(false)); } } builder.AddCustomAttributes(typeof(XName), new TypeConverterAttribute(typeof(XNameConverter))); builder.AddCustomAttributes(typeof(VBIdentifierName), new EditorAttribute(typeof(VBIdentifierNameEditor), typeof(PropertyValueEditor))); builder.AddCustomAttributes(typeof(VBIdentifierName), new EditorReuseAttribute(false)); // Apply the metadata MetadataStore.AddAttributeTable(builder.CreateTable()); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebSysDefaultValueAttribute.cs
- XPathParser.cs
- ScrollData.cs
- TreeViewImageIndexConverter.cs
- PackageRelationshipCollection.cs
- Model3DCollection.cs
- OdbcConnectionHandle.cs
- TextServicesPropertyRanges.cs
- Events.cs
- SqlExpressionNullability.cs
- ReceiveErrorHandling.cs
- JsonUriDataContract.cs
- SplineKeyFrames.cs
- UserValidatedEventArgs.cs
- PropertyDescriptorComparer.cs
- XD.cs
- SubqueryRules.cs
- FileEnumerator.cs
- Attributes.cs
- HttpWebRequest.cs
- PkcsMisc.cs
- OperandQuery.cs
- ServiceErrorHandler.cs
- SqlUtil.cs
- ComponentRenameEvent.cs
- RepeaterCommandEventArgs.cs
- HtmlWindowCollection.cs
- SpellerStatusTable.cs
- StringCollection.cs
- AuthenticationException.cs
- DecoderFallback.cs
- DependencyPropertyDescriptor.cs
- Glyph.cs
- SchemaHelper.cs
- InheritanceUI.cs
- StyleBamlTreeBuilder.cs
- CloudCollection.cs
- ServicePointManagerElement.cs
- MasterPageCodeDomTreeGenerator.cs
- ModulesEntry.cs
- GridViewPageEventArgs.cs
- SymbolMethod.cs
- SqlVisitor.cs
- ImageMapEventArgs.cs
- Pair.cs
- DynamicRendererThreadManager.cs
- AssertSection.cs
- Graph.cs
- MeshGeometry3D.cs
- SelectionUIHandler.cs
- Selector.cs
- ControlLocalizer.cs
- AddInEnvironment.cs
- ColorIndependentAnimationStorage.cs
- WebBrowserProgressChangedEventHandler.cs
- BinaryObjectWriter.cs
- EditorAttribute.cs
- NameValueConfigurationCollection.cs
- ServiceOperationDetailViewControl.cs
- HttpWebRequestElement.cs
- WebPartConnectionsDisconnectVerb.cs
- DirtyTextRange.cs
- ProfileManager.cs
- ToolStripPanel.cs
- SamlAuthorizationDecisionClaimResource.cs
- ModuleConfigurationInfo.cs
- UdpAnnouncementEndpoint.cs
- ToolbarAUtomationPeer.cs
- DynamicRenderer.cs
- RectangleF.cs
- DeferredElementTreeState.cs
- SystemParameters.cs
- QilLoop.cs
- EntityCommandExecutionException.cs
- ThicknessAnimationBase.cs
- SaveLedgerEntryRequest.cs
- FilteredSchemaElementLookUpTable.cs
- WebPartConnectVerb.cs
- _SSPIWrapper.cs
- XmlMessageFormatter.cs
- ColumnWidthChangedEvent.cs
- RoutingSection.cs
- ClientCultureInfo.cs
- ProcessModelSection.cs
- IDataContractSurrogate.cs
- FamilyCollection.cs
- safelinkcollection.cs
- WebEvents.cs
- Graphics.cs
- InitiatorSessionSymmetricMessageSecurityProtocol.cs
- CommandHelper.cs
- StreamInfo.cs
- ObjectQueryExecutionPlan.cs
- BrowserCapabilitiesFactory35.cs
- SimpleType.cs
- RegisteredHiddenField.cs
- FixedPageProcessor.cs
- VisualBasicDesignerHelper.cs
- M3DUtil.cs
- DBParameter.cs