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
- GridPattern.cs
- StorageMappingItemCollection.cs
- XmlSerializableReader.cs
- OracleBFile.cs
- DataServiceResponse.cs
- DispatcherHookEventArgs.cs
- SortDescriptionCollection.cs
- ServiceAuthorizationBehavior.cs
- GetPageCompletedEventArgs.cs
- IArgumentProvider.cs
- WebPartEventArgs.cs
- ApplicationProxyInternal.cs
- filewebresponse.cs
- RequestBringIntoViewEventArgs.cs
- TimeSpanConverter.cs
- ResetableIterator.cs
- SpecularMaterial.cs
- MaskedTextBoxTextEditorDropDown.cs
- shaperfactoryquerycachekey.cs
- CustomAttributeBuilder.cs
- TraceLog.cs
- HttpProfileGroupBase.cs
- SecurityTokenProvider.cs
- AttachedAnnotationChangedEventArgs.cs
- RegularExpressionValidator.cs
- SafeWaitHandle.cs
- MethodExpr.cs
- AppSettingsExpressionBuilder.cs
- MobileErrorInfo.cs
- HtmlForm.cs
- TextSelectionProcessor.cs
- XmlSubtreeReader.cs
- URLString.cs
- EntitySqlQueryBuilder.cs
- CompilationLock.cs
- HttpProcessUtility.cs
- SetStoryboardSpeedRatio.cs
- GroupDescription.cs
- ProcessHost.cs
- SchemaManager.cs
- InstanceDescriptor.cs
- StringUtil.cs
- dataobject.cs
- DependencyProperty.cs
- Animatable.cs
- xml.cs
- TypeCacheManager.cs
- ProfilePropertyNameValidator.cs
- XamlToRtfParser.cs
- ActivityBuilderHelper.cs
- Facet.cs
- StrokeCollection2.cs
- Stream.cs
- SqlInternalConnection.cs
- Vector3DConverter.cs
- RIPEMD160.cs
- Stack.cs
- SecureStringHasher.cs
- FloaterBaseParagraph.cs
- RoleExceptions.cs
- ButtonFieldBase.cs
- ColumnMapProcessor.cs
- printdlgexmarshaler.cs
- UnsafeNativeMethodsPenimc.cs
- DrawListViewColumnHeaderEventArgs.cs
- AuthorizationRule.cs
- WebExceptionStatus.cs
- SolidColorBrush.cs
- PreviousTrackingServiceAttribute.cs
- StreamingContext.cs
- PrivilegeNotHeldException.cs
- BamlLocalizableResource.cs
- XmlRootAttribute.cs
- MediaElement.cs
- DataList.cs
- FreezableOperations.cs
- MetaModel.cs
- _Events.cs
- AuthStoreRoleProvider.cs
- SchemaImporterExtension.cs
- UndoEngine.cs
- AuthStoreRoleProvider.cs
- RewritingSimplifier.cs
- Matrix.cs
- CookielessHelper.cs
- AuthorizationSection.cs
- RowCache.cs
- XmlAttribute.cs
- LayoutTableCell.cs
- TreeNodeStyle.cs
- HTMLTextWriter.cs
- ExpanderAutomationPeer.cs
- BamlRecords.cs
- SQLDecimal.cs
- BindUriHelper.cs
- PointF.cs
- GlobalProxySelection.cs
- HtmlMeta.cs
- FacetValues.cs
- ListViewGroupItemCollection.cs