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
- HttpListenerException.cs
- OperationResponse.cs
- WpfWebRequestHelper.cs
- ConstraintCollection.cs
- WindowInteropHelper.cs
- ExclusiveNamedPipeTransportManager.cs
- GraphicsContainer.cs
- AuthenticationSection.cs
- XmlHierarchicalDataSourceView.cs
- SmiConnection.cs
- LogicalExpr.cs
- Size3D.cs
- EmptyStringExpandableObjectConverter.cs
- ApplySecurityAndSendAsyncResult.cs
- _NTAuthentication.cs
- ContentPresenter.cs
- Byte.cs
- ReferencedType.cs
- DbConnectionPoolOptions.cs
- CngUIPolicy.cs
- Argument.cs
- SelectedCellsChangedEventArgs.cs
- BamlTreeUpdater.cs
- SmiEventSink_DeferedProcessing.cs
- Configuration.cs
- DataGridViewIntLinkedList.cs
- DbBuffer.cs
- TabControlCancelEvent.cs
- NamespaceList.cs
- IdentityModelDictionary.cs
- ShimAsPublicXamlType.cs
- InheritedPropertyChangedEventArgs.cs
- ObjectListDataBindEventArgs.cs
- RawStylusInput.cs
- ControlBuilder.cs
- IndicCharClassifier.cs
- httpapplicationstate.cs
- MetadataException.cs
- DebugTrace.cs
- FontFaceLayoutInfo.cs
- StorageMappingFragment.cs
- DurableInstanceProvider.cs
- HtmlInputReset.cs
- CompilerResults.cs
- DeferredBinaryDeserializerExtension.cs
- ProcessModelSection.cs
- EntityDataSourceWizardForm.cs
- SignatureHelper.cs
- Stack.cs
- SelectorItemAutomationPeer.cs
- VariantWrapper.cs
- Helpers.cs
- COM2IDispatchConverter.cs
- MaskedTextBox.cs
- Section.cs
- InternalSafeNativeMethods.cs
- StreamWithDictionary.cs
- StorageEndPropertyMapping.cs
- CompoundFileStorageReference.cs
- WebMessageEncodingBindingElement.cs
- FastEncoderWindow.cs
- DragEvent.cs
- Ops.cs
- DataListDesigner.cs
- RowParagraph.cs
- AuthorizationRuleCollection.cs
- AlignmentXValidation.cs
- RadioButtonStandardAdapter.cs
- WorkflowInstanceAbortedRecord.cs
- PackWebRequest.cs
- BufferBuilder.cs
- ActivityExecutionWorkItem.cs
- DesignerObjectListAdapter.cs
- DatePickerTextBox.cs
- WebServiceErrorEvent.cs
- WebInvokeAttribute.cs
- ResumeStoryboard.cs
- SerialPinChanges.cs
- DelimitedListTraceListener.cs
- XmlQualifiedName.cs
- WebControlAdapter.cs
- TextEditorParagraphs.cs
- CollectionEditorDialog.cs
- SafeArrayRankMismatchException.cs
- ShutDownListener.cs
- InterleavedZipPartStream.cs
- TaskFormBase.cs
- NavigateEvent.cs
- RawUIStateInputReport.cs
- DashStyles.cs
- LassoHelper.cs
- StateManagedCollection.cs
- HttpInputStream.cs
- HttpRuntime.cs
- KeyGestureConverter.cs
- TransformedBitmap.cs
- ExtensionFile.cs
- CancelEventArgs.cs
- DrawingVisual.cs
- DummyDataSource.cs