Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / TreeViewImageKeyConverter.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TcpClientSocketManager.cs
- ProtocolsConfiguration.cs
- WindowsAuthenticationEventArgs.cs
- updatecommandorderer.cs
- Matrix.cs
- _SSPISessionCache.cs
- EntryIndex.cs
- BaseCodePageEncoding.cs
- SqlUnionizer.cs
- DependencyObjectPropertyDescriptor.cs
- DrawingVisual.cs
- ObjectDisposedException.cs
- ConnectionPoint.cs
- HttpProfileGroupBase.cs
- CannotUnloadAppDomainException.cs
- FixedPosition.cs
- HierarchicalDataSourceControl.cs
- CodeGenerator.cs
- SiteMapNodeItem.cs
- XmlSchemaAnnotated.cs
- CreateUserWizard.cs
- DataGridItem.cs
- AbandonedMutexException.cs
- DecodeHelper.cs
- LinqDataSourceContextEventArgs.cs
- BasicBrowserDialog.designer.cs
- SqlReferenceCollection.cs
- TextMetrics.cs
- DispatcherSynchronizationContext.cs
- XmlSchemaSubstitutionGroup.cs
- SelectionChangedEventArgs.cs
- RadioButtonList.cs
- ActivationServices.cs
- StaticResourceExtension.cs
- HttpFileCollection.cs
- GraphicsContainer.cs
- EntityCommand.cs
- SQLUtility.cs
- DataGridTextColumn.cs
- OutputScopeManager.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- ConnectionStringsExpressionBuilder.cs
- CurrencyManager.cs
- DataGridViewButtonCell.cs
- PerspectiveCamera.cs
- FixedDSBuilder.cs
- GeneralTransform3DGroup.cs
- DependencyObjectProvider.cs
- DrawingImage.cs
- ParallelTimeline.cs
- SqlMultiplexer.cs
- DataGridViewColumnCollection.cs
- WaitHandleCannotBeOpenedException.cs
- BasicHttpMessageSecurity.cs
- SendingRequestEventArgs.cs
- ConfigXmlDocument.cs
- CustomSignedXml.cs
- MasterPageCodeDomTreeGenerator.cs
- DisplayNameAttribute.cs
- RoleGroupCollectionEditor.cs
- InfoCard.cs
- TableRowCollection.cs
- AsyncResult.cs
- MiniConstructorInfo.cs
- DataGridViewRowStateChangedEventArgs.cs
- SID.cs
- URL.cs
- Point4D.cs
- CursorConverter.cs
- TimeStampChecker.cs
- DetailsViewRow.cs
- XmlSchemaSimpleContentExtension.cs
- AdapterUtil.cs
- ExclusiveTcpTransportManager.cs
- SendReply.cs
- PermissionToken.cs
- HttpListenerRequestTraceRecord.cs
- ConfigXmlText.cs
- AdornerPresentationContext.cs
- TextRunCacheImp.cs
- ClosureBinding.cs
- DataGridCaption.cs
- ImageListStreamer.cs
- WorkflowDebuggerSteppingAttribute.cs
- WebPartMinimizeVerb.cs
- Size.cs
- XmlRootAttribute.cs
- NullableBoolConverter.cs
- BuildResult.cs
- PeerResolverElement.cs
- RadialGradientBrush.cs
- VideoDrawing.cs
- HMACMD5.cs
- LicenseManager.cs
- XdrBuilder.cs
- TextFormatterContext.cs
- HtmlGenericControl.cs
- ChildDocumentBlock.cs
- WebPartZoneBase.cs
- Empty.cs