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
- RegexCompilationInfo.cs
- EncodingFallbackAwareXmlTextWriter.cs
- XmlNamespaceDeclarationsAttribute.cs
- DetailsViewUpdateEventArgs.cs
- CustomLineCap.cs
- StateRuntime.cs
- TemplateControlParser.cs
- EDesignUtil.cs
- XmlNavigatorFilter.cs
- DataGridViewComboBoxColumn.cs
- Page.cs
- Rfc2898DeriveBytes.cs
- CfgArc.cs
- DependencyObjectType.cs
- GeneralTransformGroup.cs
- BoolLiteral.cs
- XmlMemberMapping.cs
- FirstMatchCodeGroup.cs
- TypeAccessException.cs
- BufferedStream.cs
- CqlParserHelpers.cs
- AccessText.cs
- QuaternionConverter.cs
- ToolZone.cs
- MemberDomainMap.cs
- CodeAssignStatement.cs
- WebBrowserContainer.cs
- ArrayElementGridEntry.cs
- TableLayoutStyleCollection.cs
- CharacterString.cs
- HttpInputStream.cs
- WpfKnownMemberInvoker.cs
- FieldAccessException.cs
- MissingSatelliteAssemblyException.cs
- QuaternionValueSerializer.cs
- AutomationElementIdentifiers.cs
- RoutingTable.cs
- ContractMethodInfo.cs
- GB18030Encoding.cs
- WindowProviderWrapper.cs
- ResXResourceSet.cs
- DocumentStream.cs
- EncodingNLS.cs
- ExtentKey.cs
- UnionCodeGroup.cs
- dataSvcMapFileLoader.cs
- IndentTextWriter.cs
- NegotiationTokenAuthenticatorState.cs
- DesignerVerbToolStripMenuItem.cs
- ChtmlCommandAdapter.cs
- BoolExpr.cs
- PenThread.cs
- DataMemberConverter.cs
- EventLogTraceListener.cs
- IpcChannel.cs
- Utils.cs
- OutOfProcStateClientManager.cs
- Pair.cs
- WindowsIdentity.cs
- DecimalAnimationUsingKeyFrames.cs
- NeutralResourcesLanguageAttribute.cs
- TrackBarRenderer.cs
- Rule.cs
- SqlNotificationEventArgs.cs
- AsyncResult.cs
- PointCollection.cs
- TabControl.cs
- HostingEnvironmentException.cs
- ValueOfAction.cs
- SecureStringHasher.cs
- ToolStripItemClickedEventArgs.cs
- XmlSchemaInfo.cs
- Vector3DConverter.cs
- StrokeCollection2.cs
- EmptyCollection.cs
- ImmutablePropertyDescriptorGridEntry.cs
- XPathDocumentNavigator.cs
- OleDbMetaDataFactory.cs
- IdnMapping.cs
- ProxyManager.cs
- RuleSettings.cs
- CodeTypeDeclarationCollection.cs
- CompressStream.cs
- PerformanceCounterTraceRecord.cs
- contentDescriptor.cs
- Semaphore.cs
- sqlinternaltransaction.cs
- ListMarkerSourceInfo.cs
- PKCS1MaskGenerationMethod.cs
- UiaCoreTypesApi.cs
- DSASignatureDeformatter.cs
- SmtpReplyReader.cs
- NullableFloatMinMaxAggregationOperator.cs
- ThemeDictionaryExtension.cs
- XPathScanner.cs
- ServiceOperationWrapper.cs
- HtmlInputHidden.cs
- PreservationFileReader.cs
- sortedlist.cs
- SQLChars.cs