Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / ListViewItemCollectionEditor.cs / 1 / ListViewItemCollectionEditor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="System.Windows.Forms.Design.ListViewItemCollectionEditor..ctor(System.Type)")] namespace System.Windows.Forms.Design { using System.Runtime.InteropServices; using System.Diagnostics; using System; using System.IO; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Windows.Forms; using System.Drawing; using System.Design; using System.Drawing.Design; using System.Windows.Forms.ComponentModel; ////// /// internal class ListViewItemCollectionEditor : CollectionEditor { /// Since this editor is using the generic form, we /// we need to keep track of newly created items so /// to tie them back to the main ListView to have /// access to all persistence properties (e.g., ImageList, etc). ////// Provides an editor for an image collection. ////// /// public ListViewItemCollectionEditor(Type type) : base(type){ } ///Initializes a new instance of the ///class. /// /// Retrieves the display text for the given list item. /// protected override string GetDisplayText(object value) { string text; if (value == null) { return string.Empty; } PropertyDescriptor prop = TypeDescriptor.GetDefaultProperty(CollectionType); if (prop != null && prop.PropertyType == typeof(string)) { text = (string)prop.GetValue(value); if (text != null && text.Length > 0) { return text; } } text = TypeDescriptor.GetConverter(value).ConvertToString(value); if (text == null || text.Length == 0) { text = value.GetType().Name; } return text; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HtmlHead.cs
- HttpGetProtocolImporter.cs
- Soap12ProtocolReflector.cs
- XmlRootAttribute.cs
- InterleavedZipPartStream.cs
- DataMisalignedException.cs
- AlgoModule.cs
- ExpressionNode.cs
- RemotingService.cs
- WebPartConnectionCollection.cs
- VisualTreeHelper.cs
- ImageAttributes.cs
- GroupBoxDesigner.cs
- FixUp.cs
- _SingleItemRequestCache.cs
- KnownTypeDataContractResolver.cs
- RegistrationServices.cs
- InvalidComObjectException.cs
- FontFamily.cs
- PersonalizationProviderHelper.cs
- CollectionCodeDomSerializer.cs
- EventProxy.cs
- Transactions.cs
- DataGridViewButtonColumn.cs
- DataGridViewTopLeftHeaderCell.cs
- MatrixKeyFrameCollection.cs
- dataobject.cs
- WebBrowserSiteBase.cs
- ProviderUtil.cs
- CacheAxisQuery.cs
- GetWinFXPath.cs
- IgnoreFileBuildProvider.cs
- Hyperlink.cs
- LockCookie.cs
- AnimationLayer.cs
- BindingGroup.cs
- SqlDataSourceSelectingEventArgs.cs
- XmlIterators.cs
- SystemIcmpV6Statistics.cs
- AsymmetricSignatureFormatter.cs
- DayRenderEvent.cs
- AutoGeneratedField.cs
- SerializationEventsCache.cs
- SpotLight.cs
- AutomationElementIdentifiers.cs
- SqlConnectionHelper.cs
- ResourceReferenceKeyNotFoundException.cs
- DataTable.cs
- StyleXamlParser.cs
- SapiInterop.cs
- PropertyAccessVisitor.cs
- RelatedImageListAttribute.cs
- RevocationPoint.cs
- ColumnResizeAdorner.cs
- HuffCodec.cs
- printdlgexmarshaler.cs
- StorageComplexTypeMapping.cs
- ErrorFormatter.cs
- WindowsFormsHelpers.cs
- TrustManagerPromptUI.cs
- DesignTimeXamlWriter.cs
- CqlWriter.cs
- MemberAssignment.cs
- While.cs
- PartitionerQueryOperator.cs
- ListSurrogate.cs
- MetadataHelper.cs
- ICspAsymmetricAlgorithm.cs
- WebPartDisplayMode.cs
- DesignTimeTemplateParser.cs
- CharConverter.cs
- BasicViewGenerator.cs
- FormView.cs
- TextLineBreak.cs
- XamlSerializerUtil.cs
- ProtocolsConfigurationEntry.cs
- HttpCachePolicyElement.cs
- Viewport3DVisual.cs
- StatementContext.cs
- ToolStripProgressBar.cs
- XmlWhitespace.cs
- Pointer.cs
- ListViewHitTestInfo.cs
- DesignerVerb.cs
- Comparer.cs
- MessageQueueConverter.cs
- SqlDataSourceCommandEventArgs.cs
- CompositeDispatchFormatter.cs
- StructuredProperty.cs
- UserMapPath.cs
- Graphics.cs
- GroupBoxRenderer.cs
- WorkflowLayouts.cs
- ControlParameter.cs
- EmbossBitmapEffect.cs
- OdbcErrorCollection.cs
- ClientConfigPaths.cs
- TransactionManagerProxy.cs
- EntityCodeGenerator.cs
- JoinTreeNode.cs