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
- TemplateInstanceAttribute.cs
- Calendar.cs
- ReferencedAssembly.cs
- VersionPair.cs
- List.cs
- Win32Exception.cs
- FlowNode.cs
- HttpContext.cs
- PerformanceCounterPermissionAttribute.cs
- SafeProcessHandle.cs
- LogicalExpressionTypeConverter.cs
- GroupItemAutomationPeer.cs
- XmlComment.cs
- OverflowException.cs
- UnionCqlBlock.cs
- InvalidOleVariantTypeException.cs
- MainMenu.cs
- AudioException.cs
- SqlDataSourceAdvancedOptionsForm.cs
- ActivityCodeDomReferenceService.cs
- TaiwanCalendar.cs
- ViewgenContext.cs
- ContentPlaceHolder.cs
- ScriptingRoleServiceSection.cs
- Graph.cs
- HtmlToClrEventProxy.cs
- SqlTriggerContext.cs
- TaiwanCalendar.cs
- PreservationFileReader.cs
- AuthStoreRoleProvider.cs
- EqualityComparer.cs
- GenerateHelper.cs
- Char.cs
- FormViewUpdatedEventArgs.cs
- SequentialWorkflowRootDesigner.cs
- TextEncodedRawTextWriter.cs
- KnownBoxes.cs
- PrintController.cs
- BufferedGraphics.cs
- GridViewCancelEditEventArgs.cs
- IconBitmapDecoder.cs
- StreamingContext.cs
- MouseActionValueSerializer.cs
- ResourcePool.cs
- Canvas.cs
- TimeoutHelper.cs
- WebResourceUtil.cs
- LinkArea.cs
- LogRestartAreaEnumerator.cs
- DataGridViewCellStyleConverter.cs
- SQLInt16.cs
- GridViewCommandEventArgs.cs
- SHA1.cs
- SizeKeyFrameCollection.cs
- WebReference.cs
- StructuralCache.cs
- AudioSignalProblemOccurredEventArgs.cs
- Item.cs
- ArraySubsetEnumerator.cs
- BufferedReadStream.cs
- Storyboard.cs
- ToolStripContentPanel.cs
- InstanceHandleConflictException.cs
- DictionarySectionHandler.cs
- Type.cs
- XmlSchemaAttributeGroup.cs
- ForceCopyBuildProvider.cs
- MembershipPasswordException.cs
- WebConfigurationManager.cs
- XmlDsigSep2000.cs
- TargetControlTypeCache.cs
- ReceiveActivityDesigner.cs
- FollowerQueueCreator.cs
- ControlPropertyNameConverter.cs
- Thread.cs
- OracleInfoMessageEventArgs.cs
- DomNameTable.cs
- XmlToDatasetMap.cs
- ActiveDocumentEvent.cs
- SEHException.cs
- SmiContextFactory.cs
- AlternateView.cs
- Span.cs
- ServiceChannelFactory.cs
- Types.cs
- TimeZoneNotFoundException.cs
- Utils.cs
- BooleanKeyFrameCollection.cs
- Mappings.cs
- NumberFormatInfo.cs
- DataServiceConfiguration.cs
- DataTableCollection.cs
- DeclarativeCatalogPart.cs
- VisualStyleElement.cs
- VirtualPathUtility.cs
- XmlSerializerFactory.cs
- coordinator.cs
- KeyGestureValueSerializer.cs
- RealProxy.cs
- ParseHttpDate.cs