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
- MaskedTextBoxDesigner.cs
- SoapHelper.cs
- TextFormatterImp.cs
- ADMembershipProvider.cs
- CellParagraph.cs
- RuntimeHandles.cs
- Rotation3DAnimationUsingKeyFrames.cs
- ContainerSelectorActiveEvent.cs
- DetailsViewModeEventArgs.cs
- Int32.cs
- XamlBuildTaskServices.cs
- EventPrivateKey.cs
- MD5.cs
- BindingObserver.cs
- EncodingDataItem.cs
- X509CertificateClaimSet.cs
- ResXResourceSet.cs
- ImageFormat.cs
- SafeNativeMethods.cs
- BitmapEffectGroup.cs
- CroppedBitmap.cs
- TileModeValidation.cs
- DelimitedListTraceListener.cs
- AttributeCollection.cs
- BuildProvider.cs
- PublisherMembershipCondition.cs
- ReadWriteSpinLock.cs
- ListDataBindEventArgs.cs
- CompoundFileDeflateTransform.cs
- EndpointIdentity.cs
- BuildTopDownAttribute.cs
- PieceDirectory.cs
- SchemaEntity.cs
- ExceptionHandlers.cs
- CompiledQueryCacheKey.cs
- BrowserCapabilitiesCompiler.cs
- MemberHolder.cs
- TiffBitmapEncoder.cs
- SQLDoubleStorage.cs
- DispatcherOperation.cs
- SingleTagSectionHandler.cs
- CalendarAutoFormat.cs
- StrokeNodeEnumerator.cs
- ExpandSegment.cs
- Ipv6Element.cs
- TypeElementCollection.cs
- Attributes.cs
- EmptyCollection.cs
- TextViewBase.cs
- BindingListCollectionView.cs
- CorePropertiesFilter.cs
- MD5.cs
- FontCollection.cs
- NotFiniteNumberException.cs
- ChtmlTextBoxAdapter.cs
- DesignerAdapterAttribute.cs
- QilXmlReader.cs
- WmpBitmapDecoder.cs
- CqlIdentifiers.cs
- Pointer.cs
- CryptoConfig.cs
- UrlMappingCollection.cs
- RelationshipConverter.cs
- PersianCalendar.cs
- HtmlTableRowCollection.cs
- Graphics.cs
- ToolBarOverflowPanel.cs
- _CacheStreams.cs
- SqlGenericUtil.cs
- ProfileSettingsCollection.cs
- DefaultTextStoreTextComposition.cs
- SHA1.cs
- Rect3DConverter.cs
- StringConverter.cs
- RealProxy.cs
- BinaryObjectInfo.cs
- ToolStripDropDown.cs
- LazyInitializer.cs
- SingleConverter.cs
- DelegateBodyWriter.cs
- TableColumnCollectionInternal.cs
- RowToFieldTransformer.cs
- MonthChangedEventArgs.cs
- ItemChangedEventArgs.cs
- EllipseGeometry.cs
- StreamWithDictionary.cs
- ParenExpr.cs
- LogLogRecordHeader.cs
- BinaryFormatterWriter.cs
- HelloMessageApril2005.cs
- DrawItemEvent.cs
- MatrixAnimationUsingPath.cs
- SurrogateEncoder.cs
- FormatSettings.cs
- ProgressChangedEventArgs.cs
- Point3DAnimationBase.cs
- ReadWriteObjectLock.cs
- CaseInsensitiveHashCodeProvider.cs
- TraceSource.cs
- ExtractedStateEntry.cs