Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / TreeViewImageKeyConverter.cs / 1 / TreeViewImageKeyConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Windows.Forms { using Microsoft.Win32; using System.Collections; using System.ComponentModel; using System.Drawing; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Collections.Specialized; ////// /// ImageIndexConverter is a class that can be used to convert /// image index values one data type to another. /// public class TreeViewImageKeyConverter : ImageKeyConverter { ////// /// Converts the given object to another type. The most common types to convert /// are to and from a string object. The default implementation will make a call /// to ToString on the object if the object is valid and if the destination /// type is string. If this cannot convert to the desitnation type, this will /// throw a NotSupportedException. /// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == null) { throw new ArgumentNullException("destinationType"); } if (destinationType == typeof(string) && (value == null)) { return SR.GetString(SR.toStringDefault); } else { string strValue = value as string; if (strValue != null && (strValue.Length == 0)) { return SR.GetString(SR.toStringDefault); } } return base.ConvertTo(context, culture, value, destinationType); } } } // 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
- QueryOpcode.cs
- PublishLicense.cs
- SqlConnectionFactory.cs
- ObjectDataSourceEventArgs.cs
- SelectionRangeConverter.cs
- Drawing.cs
- RequestCachingSection.cs
- WebPartMenuStyle.cs
- UITypeEditors.cs
- FileLoadException.cs
- BulletDecorator.cs
- AxHost.cs
- Restrictions.cs
- FieldNameLookup.cs
- EntityTypeBase.cs
- XmlArrayAttribute.cs
- GiveFeedbackEvent.cs
- TemplateBuilder.cs
- ToolStripAdornerWindowService.cs
- LinqDataSourceSelectEventArgs.cs
- DockPattern.cs
- SqlDataSourceCache.cs
- NextPreviousPagerField.cs
- RequiredFieldValidator.cs
- CryptoApi.cs
- SpeechUI.cs
- TextReader.cs
- TableAdapterManagerGenerator.cs
- WinHttpWebProxyFinder.cs
- ActivityTypeCodeDomSerializer.cs
- peersecurityelement.cs
- SqlRecordBuffer.cs
- CompositeControl.cs
- Literal.cs
- XmlConvert.cs
- XmlImplementation.cs
- WebPartExportVerb.cs
- WizardPanelChangingEventArgs.cs
- StoreAnnotationsMap.cs
- VerificationException.cs
- TextMetrics.cs
- NonBatchDirectoryCompiler.cs
- SQLDateTime.cs
- DataGridColumnHeaderCollection.cs
- MasterPage.cs
- _FtpDataStream.cs
- X500Name.cs
- ConfigurationErrorsException.cs
- SharedMemory.cs
- WebPartConnectionsDisconnectVerb.cs
- RIPEMD160.cs
- SerializationHelper.cs
- FormsAuthentication.cs
- ParseElement.cs
- RecognizedAudio.cs
- SystemPens.cs
- EntityProviderFactory.cs
- WebHeaderCollection.cs
- ActivityWithResult.cs
- UnsafeMethods.cs
- UserControlCodeDomTreeGenerator.cs
- CornerRadius.cs
- MethodImplAttribute.cs
- ReadOnlyPropertyMetadata.cs
- EditorAttributeInfo.cs
- CounterCreationData.cs
- ExtentKey.cs
- MiniParameterInfo.cs
- WebBrowserContainer.cs
- LoadMessageLogger.cs
- ResourceBinder.cs
- WebBaseEventKeyComparer.cs
- DetailsViewModeEventArgs.cs
- Hex.cs
- FixedPage.cs
- _UriTypeConverter.cs
- CustomError.cs
- TypeConverterAttribute.cs
- TemplateLookupAction.cs
- SubMenuStyle.cs
- ListenerElementsCollection.cs
- CompilerTypeWithParams.cs
- ActiveDocumentEvent.cs
- DBCommandBuilder.cs
- TablePattern.cs
- UnitySerializationHolder.cs
- _FtpControlStream.cs
- ConstraintEnumerator.cs
- FormatStringEditor.cs
- DataError.cs
- NumericUpDownAcceleration.cs
- WindowsTokenRoleProvider.cs
- TypeDescriptionProviderAttribute.cs
- InternalCache.cs
- ComEventsInfo.cs
- SqlFactory.cs
- AutomationElement.cs
- Point3DAnimationUsingKeyFrames.cs
- DataGridViewCellStateChangedEventArgs.cs
- NavigateEvent.cs