Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / Model / ModelUtilities.cs / 1305376 / ModelUtilities.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Activities.Presentation.Model { using System; using System.Collections.Generic; using System.ComponentModel; using System.Windows.Markup; // This class provides useful shared utility functions that are // needed by our ModelItemImpl class implementations. internal static class ModelUtilities { // Returns a wrapped type converter for the given item. internal static TypeConverter GetConverter(IModelTreeItem item) { return GetConverter(item.ModelTreeManager, item.ModelItem); } // Returns a wrapped converter for the given item. internal static TypeConverter GetConverter(ModelTreeManager modelTreeManager, ModelItem item) { return new ModelTypeConverter(modelTreeManager, XamlUtilities.GetConverter(item.ItemType)); } // Returns the default property on the item, or null if the item has internal static PropertyDescriptor GetDefaultProperty(ModelItem item) { DefaultPropertyAttribute propAttr = TypeDescriptor.GetAttributes(item.ItemType)[typeof(DefaultPropertyAttribute)] as DefaultPropertyAttribute; if (propAttr != null && !string.IsNullOrEmpty(propAttr.Name)) { ModelProperty prop = item.Properties.Find(propAttr.Name); if (prop != null) { return new ModelPropertyDescriptor(prop); } } return null; } // Wraps an item's properties in PropertyDescriptors and returns a // collection of them. internal static PropertyDescriptorCollection WrapProperties(ModelItem item) { Listdescriptors = new List (); foreach (ModelProperty prop in item.Properties) { descriptors.Add(new ModelPropertyDescriptor(prop)); } return new PropertyDescriptorCollection(descriptors.ToArray(), true); } } } // 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
- Base64Encoder.cs
- X509AsymmetricSecurityKey.cs
- ReachNamespaceInfo.cs
- ISFTagAndGuidCache.cs
- AttributeEmitter.cs
- CaseInsensitiveOrdinalStringComparer.cs
- versioninfo.cs
- RenderContext.cs
- Menu.cs
- PreProcessInputEventArgs.cs
- BufferBuilder.cs
- Rect3D.cs
- StylusDownEventArgs.cs
- ToolStripDropDownButton.cs
- MonitorWrapper.cs
- Header.cs
- ReadOnlyPropertyMetadata.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- WorkflowPageSetupDialog.cs
- DecoderReplacementFallback.cs
- Context.cs
- MetafileHeaderWmf.cs
- ObjectSelectorEditor.cs
- X509ChainElement.cs
- SerializationException.cs
- X509IssuerSerialKeyIdentifierClause.cs
- HttpProfileBase.cs
- BitArray.cs
- ThreadPool.cs
- _FtpDataStream.cs
- DataRelationCollection.cs
- glyphs.cs
- CompoundFileStorageReference.cs
- DataViewManager.cs
- TileModeValidation.cs
- UnsignedPublishLicense.cs
- ReadOnlyPropertyMetadata.cs
- ChannelBuilder.cs
- DataControlFieldHeaderCell.cs
- WindowsServiceCredential.cs
- CompositeFontParser.cs
- MeasurementDCInfo.cs
- ScrollBarRenderer.cs
- TrackingExtract.cs
- WebFaultClientMessageInspector.cs
- PrivilegeNotHeldException.cs
- DbConnectionClosed.cs
- SoapHeaders.cs
- UniqueIdentifierService.cs
- DATA_BLOB.cs
- BaseServiceProvider.cs
- DataGridViewRowConverter.cs
- VirtualPath.cs
- DragDeltaEventArgs.cs
- ObjectKeyFrameCollection.cs
- GeneralTransform.cs
- coordinatorfactory.cs
- Int32Converter.cs
- SqlInternalConnectionSmi.cs
- InputLanguage.cs
- CallbackBehaviorAttribute.cs
- XPathBinder.cs
- SystemTcpStatistics.cs
- Int64Converter.cs
- BigInt.cs
- Interfaces.cs
- DefaultTextStoreTextComposition.cs
- CodeComment.cs
- Parameter.cs
- Menu.cs
- Mapping.cs
- StrokeCollection2.cs
- EmitterCache.cs
- WindowsSysHeader.cs
- HwndAppCommandInputProvider.cs
- ReferenceEqualityComparer.cs
- MetadataCollection.cs
- MILUtilities.cs
- _Win32.cs
- ScrollItemPattern.cs
- AdapterUtil.cs
- ByteStreamMessageEncoder.cs
- WebEvents.cs
- _AcceptOverlappedAsyncResult.cs
- SqlProviderUtilities.cs
- CommonRemoteMemoryBlock.cs
- ProtocolsInstallComponent.cs
- SeverityFilter.cs
- DbRetry.cs
- SqlClientMetaDataCollectionNames.cs
- MexHttpBindingElement.cs
- MinMaxParagraphWidth.cs
- SafePEFileHandle.cs
- ProcessProtocolHandler.cs
- CommonBehaviorsSection.cs
- GeneralTransform2DTo3DTo2D.cs
- Int32Collection.cs
- Encoding.cs
- COAUTHINFO.cs
- ToolStripPanelCell.cs