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
- WebPartDisplayModeCollection.cs
- TemplateField.cs
- OAVariantLib.cs
- XmlBoundElement.cs
- TextRunTypographyProperties.cs
- CircleEase.cs
- DecoderNLS.cs
- WebHttpSecurityElement.cs
- RuntimeCompatibilityAttribute.cs
- BorderGapMaskConverter.cs
- DocumentEventArgs.cs
- ConfigurationPermission.cs
- AspCompat.cs
- DataGridViewRowHeaderCell.cs
- ActivityExecutionContext.cs
- NavigationExpr.cs
- GeometryCombineModeValidation.cs
- AutomationPropertyInfo.cs
- CompilationUtil.cs
- RoleManagerModule.cs
- SmiMetaDataProperty.cs
- Rotation3D.cs
- DataSet.cs
- DoubleStorage.cs
- ImageSource.cs
- ServiceDesigner.cs
- CachingHintValidation.cs
- UiaCoreTypesApi.cs
- WsatConfiguration.cs
- HTTPNotFoundHandler.cs
- ConfigXmlCDataSection.cs
- StyleSelector.cs
- Semaphore.cs
- BigInt.cs
- MouseGestureConverter.cs
- QuaternionRotation3D.cs
- TextAction.cs
- ContentElement.cs
- GPStream.cs
- MexHttpBindingElement.cs
- JumpItem.cs
- DataControlPagerLinkButton.cs
- PixelFormats.cs
- FixedBufferAttribute.cs
- FieldToken.cs
- SerializationFieldInfo.cs
- SizeConverter.cs
- RegexCode.cs
- SkewTransform.cs
- DataKey.cs
- LicenseManager.cs
- RouteParametersHelper.cs
- DBCSCodePageEncoding.cs
- HttpWebResponse.cs
- InvalidDataException.cs
- BindUriHelper.cs
- IdentifierService.cs
- dtdvalidator.cs
- AbstractExpressions.cs
- DtdParser.cs
- CompleteWizardStep.cs
- BinaryFormatter.cs
- SizeAnimationBase.cs
- ImageCodecInfoPrivate.cs
- StylusLogic.cs
- documentation.cs
- PassportPrincipal.cs
- HostedTransportConfigurationManager.cs
- EUCJPEncoding.cs
- CommandField.cs
- DiagnosticsConfiguration.cs
- FindCompletedEventArgs.cs
- PropertyChangedEventArgs.cs
- WebPartUserCapability.cs
- ImageInfo.cs
- WebServiceMethodData.cs
- TypeExtensionConverter.cs
- InstanceDescriptor.cs
- MexBindingBindingCollectionElement.cs
- TryCatchDesigner.xaml.cs
- InputScopeNameConverter.cs
- TypeListConverter.cs
- FixedDSBuilder.cs
- GACMembershipCondition.cs
- ImageMap.cs
- FusionWrap.cs
- XmlSchemaValidator.cs
- Point3DAnimationBase.cs
- SHA512.cs
- GeneralTransformGroup.cs
- XmlIgnoreAttribute.cs
- ContainerUtilities.cs
- Regex.cs
- ContractSearchPattern.cs
- SiteMap.cs
- BufferModesCollection.cs
- CodeArrayCreateExpression.cs
- DataSetFieldSchema.cs
- Bidi.cs
- GeometryHitTestParameters.cs