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
- WebZoneDesigner.cs
- DataIdProcessor.cs
- SQlBooleanStorage.cs
- FacetDescriptionElement.cs
- HyperLinkField.cs
- LocalFileSettingsProvider.cs
- Pointer.cs
- _SslState.cs
- DirectoryGroupQuery.cs
- HtmlInputSubmit.cs
- WhitespaceRuleLookup.cs
- FixedTextSelectionProcessor.cs
- TdsParserSessionPool.cs
- FormCollection.cs
- WebControlParameterProxy.cs
- DateTimeSerializationSection.cs
- HttpCacheVary.cs
- linebase.cs
- SelectionRangeConverter.cs
- GlyphTypeface.cs
- RoutedCommand.cs
- CoTaskMemSafeHandle.cs
- CallbackHandler.cs
- Bold.cs
- WebPartDescription.cs
- Vector3DIndependentAnimationStorage.cs
- ExtendedProtectionPolicyElement.cs
- ReachVisualSerializer.cs
- NameValueCollection.cs
- SiteMapNode.cs
- SqlBinder.cs
- XmlCollation.cs
- BookmarkCallbackWrapper.cs
- MeshGeometry3D.cs
- AppSettingsExpressionBuilder.cs
- ConnectionManagementElement.cs
- RewritingPass.cs
- Constants.cs
- ScrollProviderWrapper.cs
- RangeContentEnumerator.cs
- ToolStripSplitStackLayout.cs
- LeaseManager.cs
- QuotedPrintableStream.cs
- StorageConditionPropertyMapping.cs
- Attributes.cs
- SafeCertificateStore.cs
- Component.cs
- Panel.cs
- SafeViewOfFileHandle.cs
- ColorConvertedBitmap.cs
- ToolStripLabel.cs
- ArraySet.cs
- EmptyEnumerable.cs
- Knowncolors.cs
- GradientStop.cs
- TextBox.cs
- NetPeerTcpBindingElement.cs
- XmlNodeWriter.cs
- OAVariantLib.cs
- Point3DConverter.cs
- XPathNodeList.cs
- ArraySortHelper.cs
- DomainUpDown.cs
- DynamicObjectAccessor.cs
- SiteMapNode.cs
- IndividualDeviceConfig.cs
- ControlIdConverter.cs
- CharacterMetricsDictionary.cs
- XhtmlBasicImageAdapter.cs
- Button.cs
- EnumerableRowCollectionExtensions.cs
- PersonalizationProvider.cs
- PolyLineSegmentFigureLogic.cs
- StateMachine.cs
- SoapSchemaExporter.cs
- SqlNotificationRequest.cs
- BindingNavigator.cs
- MsmqTransportBindingElement.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- DropDownButton.cs
- DefaultPropertyAttribute.cs
- ArrayTypeMismatchException.cs
- MemoryFailPoint.cs
- _AcceptOverlappedAsyncResult.cs
- SystemResources.cs
- sqlcontext.cs
- SourceSwitch.cs
- DynamicDiscoveryDocument.cs
- TypeConverter.cs
- NullRuntimeConfig.cs
- CollectionTypeElement.cs
- SQLDateTimeStorage.cs
- FontEmbeddingManager.cs
- CapabilitiesSection.cs
- ObjectSecurityT.cs
- PermissionAttributes.cs
- LabelLiteral.cs
- handlecollector.cs
- RotateTransform.cs
- XmlObjectSerializerReadContext.cs