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
- ItemCollection.cs
- ContractInstanceProvider.cs
- IteratorFilter.cs
- DataGridViewRowPostPaintEventArgs.cs
- FlowNode.cs
- EntityDataSourceViewSchema.cs
- IODescriptionAttribute.cs
- PseudoWebRequest.cs
- Util.cs
- ConstantSlot.cs
- GeometryCombineModeValidation.cs
- MissingFieldException.cs
- StrokeIntersection.cs
- SafeHandles.cs
- CheckBoxRenderer.cs
- MemberMemberBinding.cs
- WebBaseEventKeyComparer.cs
- PriorityRange.cs
- ExpressionBinding.cs
- ScriptControlDescriptor.cs
- PropertyInformation.cs
- Error.cs
- Double.cs
- AlternateViewCollection.cs
- StorageComplexPropertyMapping.cs
- LinqExpressionNormalizer.cs
- smtppermission.cs
- HttpHandlerAction.cs
- XmlSchemaSimpleType.cs
- XPathAxisIterator.cs
- ConnectionInterfaceCollection.cs
- AuthStoreRoleProvider.cs
- DuplicateWaitObjectException.cs
- LinkedResource.cs
- EventProviderBase.cs
- WebPartAddingEventArgs.cs
- OptimizedTemplateContent.cs
- SafeHandles.cs
- documentation.cs
- FixedDocumentPaginator.cs
- OracleInfoMessageEventArgs.cs
- VersionedStreamOwner.cs
- CompModSwitches.cs
- AddressingProperty.cs
- ChtmlTextWriter.cs
- Point4D.cs
- RtfToXamlLexer.cs
- SQLDouble.cs
- HostingEnvironmentSection.cs
- IntegerValidator.cs
- OperationPickerDialog.designer.cs
- AppDomainManager.cs
- XmlChildEnumerator.cs
- MaskedTextBoxTextEditorDropDown.cs
- FileLevelControlBuilderAttribute.cs
- ArithmeticException.cs
- ObjectStateFormatter.cs
- ReferencedCollectionType.cs
- DllNotFoundException.cs
- EncoderParameter.cs
- Set.cs
- ClientApiGenerator.cs
- UIElementParagraph.cs
- DbQueryCommandTree.cs
- Rotation3D.cs
- TextRunCacheImp.cs
- DeferredTextReference.cs
- MultiPartWriter.cs
- ClientRuntimeConfig.cs
- ExpressionVisitor.cs
- SkinBuilder.cs
- AuthenticatedStream.cs
- CSharpCodeProvider.cs
- GestureRecognitionResult.cs
- ApplicationProxyInternal.cs
- CustomError.cs
- OleDbErrorCollection.cs
- Point3D.cs
- UnsafePeerToPeerMethods.cs
- SessionSwitchEventArgs.cs
- DataException.cs
- DataGridItemCollection.cs
- TemplateParser.cs
- SQLRoleProvider.cs
- TransformPatternIdentifiers.cs
- MethodCallConverter.cs
- mediaeventargs.cs
- SymLanguageType.cs
- XamlBrushSerializer.cs
- UIElementIsland.cs
- AtlasWeb.Designer.cs
- OleDbInfoMessageEvent.cs
- ArraySortHelper.cs
- UInt16.cs
- Propagator.JoinPropagator.cs
- RequestNavigateEventArgs.cs
- HtmlTernaryTree.cs
- TextDecorationLocationValidation.cs
- XmlNodeComparer.cs
- CatalogZoneBase.cs