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
- SHA1Cng.cs
- ClientBuildManager.cs
- WebEvents.cs
- SuppressIldasmAttribute.cs
- GridItemPatternIdentifiers.cs
- TrackBarRenderer.cs
- DataGridViewCellCancelEventArgs.cs
- PerformanceCounterPermission.cs
- DoubleLinkList.cs
- RegisteredHiddenField.cs
- PermissionToken.cs
- SapiGrammar.cs
- DataGridViewRowPostPaintEventArgs.cs
- localization.cs
- ScriptingJsonSerializationSection.cs
- MethodImplAttribute.cs
- XamlFigureLengthSerializer.cs
- XmlHelper.cs
- DataGridColumnHeadersPresenter.cs
- RawTextInputReport.cs
- XmlTextReader.cs
- DispatcherExceptionEventArgs.cs
- EventHandlingScope.cs
- XamlSerializerUtil.cs
- WsdlServiceChannelBuilder.cs
- SourceLineInfo.cs
- SctClaimDictionary.cs
- DataGridViewTextBoxCell.cs
- ProxyHwnd.cs
- InvokeGenerator.cs
- FixedSOMContainer.cs
- DynamicActivityXamlReader.cs
- Descriptor.cs
- UserUseLicenseDictionaryLoader.cs
- UIElement.cs
- figurelength.cs
- DoubleAnimationUsingKeyFrames.cs
- ValidationManager.cs
- KeyBinding.cs
- InternalTypeHelper.cs
- Form.cs
- XmlSchemaObjectTable.cs
- LeafCellTreeNode.cs
- CompilerResults.cs
- PropertyMetadata.cs
- GridViewItemAutomationPeer.cs
- shaperfactory.cs
- XmlSchemaIdentityConstraint.cs
- FieldDescriptor.cs
- WebZone.cs
- EventLogTraceListener.cs
- ConditionCollection.cs
- MetadataItemEmitter.cs
- ObfuscationAttribute.cs
- MetadataArtifactLoader.cs
- WindowsToolbar.cs
- MaskedTextBox.cs
- Debug.cs
- LogLogRecordEnumerator.cs
- TableCell.cs
- DbMetaDataColumnNames.cs
- InputLangChangeEvent.cs
- EmptyStringExpandableObjectConverter.cs
- ServerIdentity.cs
- X509Certificate2.cs
- XmlAttributeProperties.cs
- TriState.cs
- ParallelActivityDesigner.cs
- SqlEnums.cs
- ProxyWebPartConnectionCollection.cs
- OdbcDataReader.cs
- CodeBlockBuilder.cs
- GlyphsSerializer.cs
- IPPacketInformation.cs
- PropertyGeneratedEventArgs.cs
- TransformerConfigurationWizardBase.cs
- TypeInfo.cs
- CacheRequest.cs
- WSDualHttpSecurity.cs
- HttpCacheVaryByContentEncodings.cs
- PageBuildProvider.cs
- HttpVersion.cs
- Attachment.cs
- WindowsToolbarItemAsMenuItem.cs
- ProfileService.cs
- MouseOverProperty.cs
- Thickness.cs
- OdbcErrorCollection.cs
- CloseSequence.cs
- HttpEncoderUtility.cs
- SafeLibraryHandle.cs
- MessageDecoder.cs
- DeferredTextReference.cs
- FactoryRecord.cs
- Soap11ServerProtocol.cs
- Block.cs
- AuthenticodeSignatureInformation.cs
- RegexMatch.cs
- mediaeventargs.cs
- PrivateUnsafeNativeCompoundFileMethods.cs