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
- SerializationObjectManager.cs
- Ops.cs
- VectorKeyFrameCollection.cs
- Rectangle.cs
- EditorBrowsableAttribute.cs
- EventLogEntryCollection.cs
- ToolBarButton.cs
- BStrWrapper.cs
- TemplateField.cs
- StringArrayConverter.cs
- StorageMappingItemCollection.cs
- Int32.cs
- MultiDataTrigger.cs
- GridSplitter.cs
- WebHeaderCollection.cs
- ValidationError.cs
- SchemaComplexType.cs
- DbCommandDefinition.cs
- Unit.cs
- DesignerCategoryAttribute.cs
- MultipleViewPattern.cs
- DataGridViewCellParsingEventArgs.cs
- TextRenderer.cs
- SqlInternalConnectionSmi.cs
- TextTreeText.cs
- VersionedStream.cs
- HostTimeoutsElement.cs
- RuntimeConfigurationRecord.cs
- TypeSource.cs
- XmlObjectSerializerReadContextComplex.cs
- DictionaryKeyPropertyAttribute.cs
- PaintEvent.cs
- XmlElementAttribute.cs
- TextEffect.cs
- PartialTrustVisibleAssembliesSection.cs
- DefaultValueAttribute.cs
- FastPropertyAccessor.cs
- HttpListenerTimeoutManager.cs
- RadioButtonStandardAdapter.cs
- PrivateFontCollection.cs
- TextChange.cs
- BitmapFrame.cs
- ClrProviderManifest.cs
- WarningException.cs
- DataServiceProviderWrapper.cs
- SvcFileManager.cs
- Switch.cs
- ExpressionBuilderCollection.cs
- IndexedWhereQueryOperator.cs
- MutexSecurity.cs
- XmlSchemaAppInfo.cs
- ReaderWriterLockWrapper.cs
- Workspace.cs
- XmlTextReaderImplHelpers.cs
- _CacheStreams.cs
- ScriptingScriptResourceHandlerSection.cs
- MenuItem.cs
- MdiWindowListItemConverter.cs
- UnmanagedMemoryStream.cs
- Vars.cs
- ProjectionPruner.cs
- WeakEventTable.cs
- MonthCalendar.cs
- ConfigXmlElement.cs
- DrawingGroupDrawingContext.cs
- ResXResourceWriter.cs
- LicFileLicenseProvider.cs
- GeometryGroup.cs
- WebPartZone.cs
- SerializationObjectManager.cs
- DefaultHttpHandler.cs
- SortQuery.cs
- SeekStoryboard.cs
- MouseWheelEventArgs.cs
- NamedPipeWorkerProcess.cs
- SelectionWordBreaker.cs
- ThumbAutomationPeer.cs
- WSFederationHttpBindingElement.cs
- InlineCollection.cs
- HttpValueCollection.cs
- HtmlTableCellCollection.cs
- Marshal.cs
- ConsumerConnectionPoint.cs
- DefaultValueAttribute.cs
- basevalidator.cs
- Deflater.cs
- WindowsGraphicsWrapper.cs
- LinqMaximalSubtreeNominator.cs
- SurrogateEncoder.cs
- InfoCardClaimCollection.cs
- SqlProcedureAttribute.cs
- Serialization.cs
- Hashtable.cs
- SQLDecimalStorage.cs
- ConfigXmlWhitespace.cs
- ListManagerBindingsCollection.cs
- Opcode.cs
- SerialReceived.cs
- DbConnectionPoolGroupProviderInfo.cs
- DataGridViewUtilities.cs