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
- TdsParameterSetter.cs
- UInt64.cs
- GridView.cs
- Rule.cs
- CodeDelegateCreateExpression.cs
- StickyNoteHelper.cs
- Clause.cs
- XmlTextReaderImpl.cs
- LeafCellTreeNode.cs
- ObjectDataSourceSelectingEventArgs.cs
- mediapermission.cs
- CompensationParticipant.cs
- MemberHolder.cs
- GiveFeedbackEventArgs.cs
- VoiceObjectToken.cs
- XmlKeywords.cs
- ScrollViewer.cs
- EventSinkHelperWriter.cs
- CompiledAction.cs
- UnsafeNativeMethods.cs
- PopOutPanel.cs
- HttpAsyncResult.cs
- EditorPartCollection.cs
- BaseProcessor.cs
- ISCIIEncoding.cs
- IssuedSecurityTokenProvider.cs
- PerformanceCounterManager.cs
- HandlerBase.cs
- CapabilitiesAssignment.cs
- BitmapImage.cs
- WebPartCollection.cs
- StateChangeEvent.cs
- FontClient.cs
- RightsManagementInformation.cs
- WsatServiceAddress.cs
- TypeNameConverter.cs
- TreeNodeClickEventArgs.cs
- MsmqEncryptionAlgorithm.cs
- KeyNotFoundException.cs
- FlowLayoutSettings.cs
- SqlParameterCollection.cs
- ReadOnlyDictionary.cs
- DoubleUtil.cs
- XsltLoader.cs
- Hash.cs
- JoinElimination.cs
- DataTableExtensions.cs
- Base64Encoder.cs
- VariableModifiersHelper.cs
- BaseTreeIterator.cs
- TargetConverter.cs
- DocobjHost.cs
- SqlProviderManifest.cs
- FontNamesConverter.cs
- TableDetailsRow.cs
- TableCellCollection.cs
- TextElementEditingBehaviorAttribute.cs
- ItemDragEvent.cs
- TextBreakpoint.cs
- ToolTipAutomationPeer.cs
- ManagementOptions.cs
- GridItemCollection.cs
- BrowserDefinitionCollection.cs
- FileDialog_Vista.cs
- SystemWebCachingSectionGroup.cs
- UnmanagedMemoryStreamWrapper.cs
- webeventbuffer.cs
- TreeNodeCollection.cs
- DataBoundControlHelper.cs
- DbConnectionPoolGroupProviderInfo.cs
- BindingList.cs
- TableProviderWrapper.cs
- documentsequencetextpointer.cs
- DataGridToolTip.cs
- ImagingCache.cs
- objectquery_tresulttype.cs
- Monitor.cs
- QilReference.cs
- EntityConnection.cs
- DispatchWrapper.cs
- ManagedWndProcTracker.cs
- __ComObject.cs
- Memoizer.cs
- FontFaceLayoutInfo.cs
- EncryptedReference.cs
- TrimSurroundingWhitespaceAttribute.cs
- MemberDescriptor.cs
- SingleTagSectionHandler.cs
- HostedNamedPipeTransportManager.cs
- ActivityStateRecord.cs
- QuerySetOp.cs
- TreeIterator.cs
- IItemContainerGenerator.cs
- NetworkInformationPermission.cs
- CodeDomComponentSerializationService.cs
- CrossSiteScriptingValidation.cs
- AppDomainShutdownMonitor.cs
- OleDbParameter.cs
- AutomationPatternInfo.cs
- ImportStoreException.cs