Code:
/ FX-1434 / FX-1434 / 1.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
- serverconfig.cs
- IChannel.cs
- ImageKeyConverter.cs
- RuntimeArgumentHandle.cs
- SpecularMaterial.cs
- RemoteWebConfigurationHostServer.cs
- CodeLinePragma.cs
- Stopwatch.cs
- HtmlGenericControl.cs
- TableRow.cs
- SqlProviderManifest.cs
- LongValidator.cs
- DocumentViewerBaseAutomationPeer.cs
- ComponentChangedEvent.cs
- ContentFileHelper.cs
- XhtmlBasicLinkAdapter.cs
- XmlNode.cs
- AttributedMetaModel.cs
- GridEntryCollection.cs
- ScriptIgnoreAttribute.cs
- HttpProcessUtility.cs
- InstallerTypeAttribute.cs
- IndexedString.cs
- WaitForChangedResult.cs
- HttpCachePolicy.cs
- AppDomainProtocolHandler.cs
- WebPartCatalogCloseVerb.cs
- ChangePasswordAutoFormat.cs
- StreamSecurityUpgradeInitiatorAsyncResult.cs
- PinnedBufferMemoryStream.cs
- DataGridViewElement.cs
- SnapshotChangeTrackingStrategy.cs
- FixedSOMGroup.cs
- Tracer.cs
- DesignerActionList.cs
- OdbcPermission.cs
- TableColumn.cs
- DataTrigger.cs
- XsltException.cs
- GuidTagList.cs
- HandledMouseEvent.cs
- HtmlButton.cs
- SystemIPv4InterfaceProperties.cs
- ProfileManager.cs
- UTF8Encoding.cs
- GridEntryCollection.cs
- PageSetupDialog.cs
- XmlAutoDetectWriter.cs
- Matrix3DConverter.cs
- SQLByte.cs
- Query.cs
- Stopwatch.cs
- TraceFilter.cs
- FunctionMappingTranslator.cs
- UnauthorizedWebPart.cs
- TextParagraph.cs
- CompositeActivityTypeDescriptorProvider.cs
- HandleDictionary.cs
- SystemWebSectionGroup.cs
- SerializationInfoEnumerator.cs
- CompilerScope.Storage.cs
- FontStyleConverter.cs
- DiagnosticsConfiguration.cs
- InternalConfigSettingsFactory.cs
- PackWebRequest.cs
- ImportContext.cs
- ControlCollection.cs
- TemplateColumn.cs
- TextFormatter.cs
- IdentityReference.cs
- ItemList.cs
- ReadOnlyCollectionBase.cs
- IODescriptionAttribute.cs
- RegionIterator.cs
- ExpressionVisitor.cs
- UseLicense.cs
- AuthenticationModuleElement.cs
- InputLanguageProfileNotifySink.cs
- XmlSchemaAll.cs
- SecureEnvironment.cs
- FileDialog.cs
- ISAPIWorkerRequest.cs
- HttpListenerException.cs
- CommandField.cs
- SettingsPropertyWrongTypeException.cs
- Effect.cs
- XPathBinder.cs
- BindingEntityInfo.cs
- MetadataSource.cs
- XamlStream.cs
- StylusPlugin.cs
- FlowDocumentReaderAutomationPeer.cs
- Assert.cs
- HttpWebRequest.cs
- AccessDataSourceView.cs
- ObjectAnimationUsingKeyFrames.cs
- HtmlMobileTextWriter.cs
- AuthenticationModuleElement.cs
- FromRequest.cs
- WindowsButton.cs