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
- VersionedStreamOwner.cs
- ColumnMapProcessor.cs
- ACE.cs
- BitmapMetadata.cs
- DataGridViewColumnDesigner.cs
- CacheEntry.cs
- NamedPipeConnectionPool.cs
- XmlStreamStore.cs
- WebDescriptionAttribute.cs
- StandardMenuStripVerb.cs
- ImageUrlEditor.cs
- WorkflowApplicationAbortedEventArgs.cs
- Tablet.cs
- WebEventTraceProvider.cs
- ProtocolsConfigurationEntry.cs
- ObjectSecurity.cs
- HttpResponseInternalWrapper.cs
- ValidatingReaderNodeData.cs
- QilNode.cs
- loginstatus.cs
- DataGridViewSelectedCellCollection.cs
- SerializableAttribute.cs
- DescendentsWalkerBase.cs
- DesignerUtility.cs
- CollectionViewSource.cs
- KeyValuePairs.cs
- ExportException.cs
- KeyboardNavigation.cs
- ProviderManager.cs
- ToolStripDropDownItem.cs
- Globals.cs
- SHA384.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- Point3DAnimationUsingKeyFrames.cs
- SystemIcmpV4Statistics.cs
- DataGridViewCellStyle.cs
- DataGridTextBoxColumn.cs
- XmlSignatureManifest.cs
- AutomationAttributeInfo.cs
- ColorPalette.cs
- PropertyGridDesigner.cs
- TabControlAutomationPeer.cs
- AuthenticationServiceManager.cs
- NodeLabelEditEvent.cs
- NotificationContext.cs
- DeclarativeExpressionConditionDeclaration.cs
- MenuItemCollection.cs
- WindowsListViewItemCheckBox.cs
- XLinq.cs
- SocketCache.cs
- OleDbErrorCollection.cs
- CallbackHandler.cs
- TextTreeInsertElementUndoUnit.cs
- CodeConstructor.cs
- BufferedWebEventProvider.cs
- Interlocked.cs
- WindowsGraphicsCacheManager.cs
- ProxyManager.cs
- TrackingAnnotationCollection.cs
- Query.cs
- XPathDocumentNavigator.cs
- ZipIOExtraFieldZip64Element.cs
- ConversionContext.cs
- SqlFunctions.cs
- CodeMethodMap.cs
- AncestorChangedEventArgs.cs
- SortQuery.cs
- ErrorHandler.cs
- DesignerTransactionCloseEvent.cs
- GridProviderWrapper.cs
- AttributeCollection.cs
- ControllableStoryboardAction.cs
- SpeechSynthesizer.cs
- PrimarySelectionAdorner.cs
- SQLByte.cs
- DelegateTypeInfo.cs
- SignatureGenerator.cs
- XamlWriter.cs
- BitmapInitialize.cs
- SrgsDocumentParser.cs
- _CookieModule.cs
- HttpHeaderCollection.cs
- AttachedProperty.cs
- GuidTagList.cs
- NameObjectCollectionBase.cs
- FixedTextSelectionProcessor.cs
- CreateUserErrorEventArgs.cs
- DisplayInformation.cs
- _BufferOffsetSize.cs
- ToolStripStatusLabel.cs
- FormatVersion.cs
- MatcherBuilder.cs
- EventSinkActivityDesigner.cs
- DesigntimeLicenseContextSerializer.cs
- CriticalExceptions.cs
- ConfigUtil.cs
- TextStore.cs
- TextBoxDesigner.cs
- BufferedGraphicsManager.cs
- RefType.cs