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
- DataGridViewCellConverter.cs
- ListBox.cs
- SizeChangedEventArgs.cs
- Transactions.cs
- ProgressBar.cs
- DirectoryInfo.cs
- FormViewAutoFormat.cs
- ContentDisposition.cs
- TimeoutValidationAttribute.cs
- documentsequencetextview.cs
- remotingproxy.cs
- XmlEncodedRawTextWriter.cs
- SequenceDesigner.cs
- StaticTextPointer.cs
- DocumentViewerHelper.cs
- ChangesetResponse.cs
- NaturalLanguageHyphenator.cs
- DetailsViewDeleteEventArgs.cs
- ScriptResourceMapping.cs
- ICspAsymmetricAlgorithm.cs
- StandardToolWindows.cs
- _AutoWebProxyScriptWrapper.cs
- XhtmlConformanceSection.cs
- HttpServerUtilityWrapper.cs
- XslCompiledTransform.cs
- DataControlButton.cs
- CoTaskMemUnicodeSafeHandle.cs
- ListBoxItemWrapperAutomationPeer.cs
- ScheduleChanges.cs
- PolicyStatement.cs
- TraceSection.cs
- ConfigPathUtility.cs
- SqlBulkCopyColumnMapping.cs
- ReadOnlyPropertyMetadata.cs
- CompositeCollectionView.cs
- MessageHeaderInfoTraceRecord.cs
- XmlWrappingReader.cs
- Transform3D.cs
- ListViewPagedDataSource.cs
- TemplateComponentConnector.cs
- DomainConstraint.cs
- StandardOleMarshalObject.cs
- NTAccount.cs
- TypeDelegator.cs
- _NestedSingleAsyncResult.cs
- TextWriterTraceListener.cs
- ReflectPropertyDescriptor.cs
- UpdatableGenericsFeature.cs
- TrustManagerPromptUI.cs
- NaturalLanguageHyphenator.cs
- TrustSection.cs
- NameSpaceExtractor.cs
- ReflectTypeDescriptionProvider.cs
- XamlRtfConverter.cs
- HttpClientCertificate.cs
- WindowsGraphics.cs
- AuthenticationManager.cs
- ProxyElement.cs
- ProxyGenerationError.cs
- StopStoryboard.cs
- XmlCDATASection.cs
- TypeElement.cs
- ValueUnavailableException.cs
- cookie.cs
- DataGridViewTopRowAccessibleObject.cs
- EventLogPropertySelector.cs
- WebPartEditVerb.cs
- SerializableTypeCodeDomSerializer.cs
- SelectedGridItemChangedEvent.cs
- CompoundFileReference.cs
- TraceUtility.cs
- ConnectionOrientedTransportChannelFactory.cs
- RegexMatch.cs
- PropertyValue.cs
- WindowsBrush.cs
- FrameAutomationPeer.cs
- QuaternionIndependentAnimationStorage.cs
- Rotation3DAnimation.cs
- TypeResolver.cs
- RealizationContext.cs
- pingexception.cs
- JsonReaderDelegator.cs
- NestPullup.cs
- ClaimSet.cs
- HttpRuntime.cs
- Helpers.cs
- BamlResourceDeserializer.cs
- Version.cs
- NameTable.cs
- DBPropSet.cs
- QueryContinueDragEventArgs.cs
- Char.cs
- KerberosTicketHashIdentifierClause.cs
- CultureInfoConverter.cs
- DataObjectFieldAttribute.cs
- SelectionRange.cs
- ProbeRequestResponseAsyncResult.cs
- XmlSchemas.cs
- ConfigXmlSignificantWhitespace.cs
- TypeUnloadedException.cs