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
- ToolboxComponentsCreatedEventArgs.cs
- LinkGrep.cs
- DbLambda.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- XhtmlBasicObjectListAdapter.cs
- ServiceDebugElement.cs
- HelpEvent.cs
- CharAnimationUsingKeyFrames.cs
- TreeNodeStyleCollection.cs
- DataObjectFieldAttribute.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- webeventbuffer.cs
- CryptoKeySecurity.cs
- StrokeNodeData.cs
- ContextBase.cs
- ParseNumbers.cs
- GeneralTransform3DGroup.cs
- ForwardPositionQuery.cs
- FirstQueryOperator.cs
- SpecialFolderEnumConverter.cs
- BindToObject.cs
- Transform3D.cs
- CoTaskMemUnicodeSafeHandle.cs
- IOThreadScheduler.cs
- Group.cs
- XmlNode.cs
- EntityReference.cs
- mansign.cs
- RegexCapture.cs
- TraceSwitch.cs
- ConfigPathUtility.cs
- XmlIlGenerator.cs
- MainMenu.cs
- View.cs
- SimpleType.cs
- BrushConverter.cs
- SerializableReadOnlyDictionary.cs
- DurableMessageDispatchInspector.cs
- ExpanderAutomationPeer.cs
- DataObjectSettingDataEventArgs.cs
- ChangePassword.cs
- XmlEntityReference.cs
- Stream.cs
- ApplicationSecurityManager.cs
- PaintEvent.cs
- EdgeProfileValidation.cs
- TableRowGroup.cs
- SqlBulkCopy.cs
- ByteStorage.cs
- ISO2022Encoding.cs
- DataGridSortCommandEventArgs.cs
- ImageDrawing.cs
- RegexFCD.cs
- xml.cs
- TreeNodeEventArgs.cs
- MenuItemStyleCollection.cs
- InstancePersistenceContext.cs
- FileUpload.cs
- ManagedFilter.cs
- CodeRegionDirective.cs
- MessageAction.cs
- AccessDataSourceWizardForm.cs
- EncoderReplacementFallback.cs
- BuiltInExpr.cs
- FlowDocumentFormatter.cs
- SqlRowUpdatingEvent.cs
- WebServiceMethodData.cs
- BufferedReadStream.cs
- EditorPartChrome.cs
- ThaiBuddhistCalendar.cs
- LocatorPart.cs
- StrongTypingException.cs
- TextElementAutomationPeer.cs
- Semaphore.cs
- InvalidProgramException.cs
- EventData.cs
- InputLangChangeRequestEvent.cs
- DirectoryRootQuery.cs
- HyperLinkColumn.cs
- StringCollectionMarkupSerializer.cs
- GeometryModel3D.cs
- _ShellExpression.cs
- MetadataException.cs
- DragDrop.cs
- SmiSettersStream.cs
- TemplateBindingExtension.cs
- GenericsInstances.cs
- EpmTargetPathSegment.cs
- ping.cs
- FixedSOMPageConstructor.cs
- SByteStorage.cs
- DataControlButton.cs
- ImageMetadata.cs
- DesignerActionGlyph.cs
- RTLAwareMessageBox.cs
- SQLStringStorage.cs
- dataprotectionpermissionattribute.cs
- Serializer.cs
- DocumentViewerHelper.cs
- EntityDataSourceView.cs