Code:
/ DotNET / DotNET / 8.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
- ImageInfo.cs
- OleDbConnectionInternal.cs
- ArgumentNullException.cs
- LoginView.cs
- SQLBytesStorage.cs
- ArithmeticException.cs
- WebSysDisplayNameAttribute.cs
- TaiwanLunisolarCalendar.cs
- EntitySetDataBindingList.cs
- RegisteredExpandoAttribute.cs
- SqlConnectionPoolGroupProviderInfo.cs
- DBConnection.cs
- CachedTypeface.cs
- CompiledQueryCacheEntry.cs
- ComplexPropertyEntry.cs
- X509CertificateStore.cs
- DependencyObjectCodeDomSerializer.cs
- Encoder.cs
- InputEventArgs.cs
- StatusStrip.cs
- RunWorkerCompletedEventArgs.cs
- Table.cs
- CommandEventArgs.cs
- CheckBoxFlatAdapter.cs
- DES.cs
- HtmlSelect.cs
- JumpItem.cs
- XmlReader.cs
- RemoteWebConfigurationHostServer.cs
- SmtpDigestAuthenticationModule.cs
- tibetanshape.cs
- MemoryMappedViewStream.cs
- PropertyPushdownHelper.cs
- CodeDirectionExpression.cs
- SystemMulticastIPAddressInformation.cs
- CustomAssemblyResolver.cs
- VerificationException.cs
- selecteditemcollection.cs
- TypeElementCollection.cs
- RegexFCD.cs
- GridViewEditEventArgs.cs
- wgx_exports.cs
- PackageFilter.cs
- SymmetricAlgorithm.cs
- SubMenuStyle.cs
- MessageFormatterConverter.cs
- UnaryNode.cs
- ValueType.cs
- TreeNode.cs
- SafeFindHandle.cs
- FormViewInsertedEventArgs.cs
- QueryStringConverter.cs
- FileDialog_Vista.cs
- XmlSchemaInclude.cs
- ManipulationDevice.cs
- SiteMapDataSourceView.cs
- DocumentOrderQuery.cs
- MD5CryptoServiceProvider.cs
- InvalidOleVariantTypeException.cs
- FileIOPermission.cs
- BulletDecorator.cs
- SoapSchemaImporter.cs
- Binding.cs
- BamlBinaryWriter.cs
- NativeMethods.cs
- SystemIdentity.cs
- UpdatePanel.cs
- ReflectEventDescriptor.cs
- EventSchemaTraceListener.cs
- UndoManager.cs
- baseshape.cs
- LogRecordSequence.cs
- BamlTreeNode.cs
- DesignerAutoFormatStyle.cs
- Object.cs
- Schema.cs
- Table.cs
- SqlFlattener.cs
- ElementNotEnabledException.cs
- FontFamilyIdentifier.cs
- TypeUsageBuilder.cs
- SizeValueSerializer.cs
- OdbcReferenceCollection.cs
- RuntimeEnvironment.cs
- NavigationPropertyAccessor.cs
- UpdatePanel.cs
- LiteralTextParser.cs
- MessageSecurityTokenVersion.cs
- OverlappedAsyncResult.cs
- DataGridViewHitTestInfo.cs
- FixedSOMElement.cs
- Activator.cs
- XmlReader.cs
- EpmAttributeNameBuilder.cs
- BamlCollectionHolder.cs
- PolicyAssertionCollection.cs
- ProviderException.cs
- ExpressionBindingCollection.cs
- BoundConstants.cs
- PipelineModuleStepContainer.cs