Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------- // 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
- NullExtension.cs
- Font.cs
- HttpServerChannel.cs
- AdornerHitTestResult.cs
- XmlReader.cs
- ReadonlyMessageFilter.cs
- CompilationSection.cs
- EnumConverter.cs
- StringDictionary.cs
- FormatException.cs
- NameSpaceExtractor.cs
- GatewayDefinition.cs
- CompositionAdorner.cs
- XmlSchemaComplexContent.cs
- DataGridViewControlCollection.cs
- Utils.cs
- SystemBrushes.cs
- SiteMapNode.cs
- ObjectListCommandsPage.cs
- ProfileParameter.cs
- TransportReplyChannelAcceptor.cs
- TimeoutStream.cs
- ProfileWorkflowElement.cs
- DiscoveryDocumentSerializer.cs
- ContextProperty.cs
- BaseParagraph.cs
- WindowsTokenRoleProvider.cs
- WebReferencesBuildProvider.cs
- DataGridViewSortCompareEventArgs.cs
- XamlToRtfParser.cs
- CodePageEncoding.cs
- _IPv6Address.cs
- RawKeyboardInputReport.cs
- WsrmTraceRecord.cs
- MessageOperationFormatter.cs
- XmlBoundElement.cs
- XmlComment.cs
- BoundConstants.cs
- ListViewInsertedEventArgs.cs
- RoutedPropertyChangedEventArgs.cs
- StringFunctions.cs
- FormViewRow.cs
- HttpProfileGroupBase.cs
- SerializationSectionGroup.cs
- BitArray.cs
- XmlRootAttribute.cs
- DataGrid.cs
- DataGridHyperlinkColumn.cs
- PaginationProgressEventArgs.cs
- ToolStripContentPanel.cs
- DrawingServices.cs
- DictionaryBase.cs
- newinstructionaction.cs
- TransformerInfoCollection.cs
- Int32EqualityComparer.cs
- TextEffect.cs
- Typeface.cs
- EventSource.cs
- CombinedGeometry.cs
- ExtensibleClassFactory.cs
- GridEntryCollection.cs
- ShapeTypeface.cs
- ClientRuntimeConfig.cs
- ItemCheckEvent.cs
- Operand.cs
- GenericRootAutomationPeer.cs
- PeerObject.cs
- TextFormatterImp.cs
- SessionStateItemCollection.cs
- VarRefManager.cs
- DeviceContext2.cs
- HierarchicalDataSourceControl.cs
- PropertyNames.cs
- SettingsPropertyValueCollection.cs
- MetadataSource.cs
- Light.cs
- CellCreator.cs
- Viewport2DVisual3D.cs
- SerializableAttribute.cs
- SizeFConverter.cs
- TemplateInstanceAttribute.cs
- TaskSchedulerException.cs
- OracleColumn.cs
- HTTPNotFoundHandler.cs
- ReferenceConverter.cs
- ElementHostAutomationPeer.cs
- MenuItemBinding.cs
- CLRBindingWorker.cs
- NamespaceCollection.cs
- AxisAngleRotation3D.cs
- SafeNativeMethods.cs
- XmlNodeChangedEventManager.cs
- DataGridViewCellValueEventArgs.cs
- BoundPropertyEntry.cs
- LazyInitializer.cs
- ObjectContextServiceProvider.cs
- NameSpaceExtractor.cs
- ComMethodElementCollection.cs
- DataTemplate.cs
- TdsValueSetter.cs