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
- DataControlFieldsEditor.cs
- WebServiceHost.cs
- Renderer.cs
- SupportsEventValidationAttribute.cs
- MetricEntry.cs
- WorkflowInstanceAbortedRecord.cs
- KnownTypesHelper.cs
- Point3DCollection.cs
- ControlCachePolicy.cs
- ContentElementCollection.cs
- CreateUserWizardAutoFormat.cs
- StandardCommandToolStripMenuItem.cs
- Substitution.cs
- ImageInfo.cs
- Column.cs
- FileLevelControlBuilderAttribute.cs
- BamlLocalizationDictionary.cs
- XmlRootAttribute.cs
- designeractionlistschangedeventargs.cs
- TypeReference.cs
- BooleanAnimationUsingKeyFrames.cs
- PerformanceCountersElement.cs
- TemplateControlCodeDomTreeGenerator.cs
- TextClipboardData.cs
- XmlText.cs
- BStrWrapper.cs
- ActivatedMessageQueue.cs
- SubqueryRules.cs
- CommittableTransaction.cs
- MediaElementAutomationPeer.cs
- SqlBooleanMismatchVisitor.cs
- XmlTextReaderImplHelpers.cs
- FontSourceCollection.cs
- RSATokenProvider.cs
- SettingsBindableAttribute.cs
- DynamicDataManager.cs
- CalendarButtonAutomationPeer.cs
- UnhandledExceptionEventArgs.cs
- DNS.cs
- XmlSubtreeReader.cs
- ApplicationInfo.cs
- TrackingServices.cs
- DispatcherExceptionEventArgs.cs
- PersonalizablePropertyEntry.cs
- TableLayoutPanelResizeGlyph.cs
- LabelLiteral.cs
- IntMinMaxAggregationOperator.cs
- XamlSerializerUtil.cs
- ErrorFormatterPage.cs
- Int32CollectionConverter.cs
- SQLMoney.cs
- basecomparevalidator.cs
- Vector3DCollection.cs
- XamlVector3DCollectionSerializer.cs
- StateElementCollection.cs
- basecomparevalidator.cs
- XmlMapping.cs
- CultureMapper.cs
- SspiSecurityTokenProvider.cs
- SQLStringStorage.cs
- TextRunCache.cs
- WindowsFont.cs
- CommonDialog.cs
- DataSourceControl.cs
- _PooledStream.cs
- XmlSchemaComplexType.cs
- SByteStorage.cs
- WindowsRichEdit.cs
- WebPartConnectionsDisconnectVerb.cs
- XmlWrappingWriter.cs
- SourceInterpreter.cs
- CompModSwitches.cs
- DataPagerFieldCommandEventArgs.cs
- SelectionRange.cs
- ContentPresenter.cs
- ControlUtil.cs
- AppDomainGrammarProxy.cs
- OutputCacheProfile.cs
- AutoResetEvent.cs
- TableParaClient.cs
- Attributes.cs
- FontStretchConverter.cs
- CodeStatement.cs
- RectangleF.cs
- TopClause.cs
- TemplateXamlTreeBuilder.cs
- DefinitionUpdate.cs
- SqlRowUpdatedEvent.cs
- EventLogPermissionEntryCollection.cs
- NullableIntSumAggregationOperator.cs
- EntryIndex.cs
- CounterSample.cs
- WebPartManagerInternals.cs
- ParameterModifier.cs
- Control.cs
- TitleStyle.cs
- FontConverter.cs
- MailAddress.cs
- SimpleWorkerRequest.cs
- XmlIncludeAttribute.cs