Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / TreeViewImageKeyConverter.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- JsonFormatReaderGenerator.cs
- TokenFactoryFactory.cs
- XsltContext.cs
- GeometryGroup.cs
- DifferencingCollection.cs
- Rect3DValueSerializer.cs
- Viewport2DVisual3D.cs
- ComponentDispatcher.cs
- ActiveDocumentEvent.cs
- EventMappingSettings.cs
- oledbmetadatacolumnnames.cs
- BindingGraph.cs
- InvalidCommandTreeException.cs
- ValuePattern.cs
- TdsParserStateObject.cs
- SmtpReplyReader.cs
- ResolveNameEventArgs.cs
- MetadataItemCollectionFactory.cs
- DocumentPropertiesDialog.cs
- XmlNodeChangedEventArgs.cs
- SamlAttributeStatement.cs
- OLEDB_Util.cs
- XmlTextAttribute.cs
- MessageTransmitTraceRecord.cs
- BrushMappingModeValidation.cs
- DesignerView.xaml.cs
- WebPartConnectionsDisconnectVerb.cs
- ChannelManager.cs
- SqlServer2KCompatibilityAnnotation.cs
- StandardToolWindows.cs
- HelpEvent.cs
- TypeRestriction.cs
- EdmItemCollection.cs
- OrderedDictionaryStateHelper.cs
- RequestValidator.cs
- Property.cs
- ProtocolState.cs
- RectangleGeometry.cs
- DbDataSourceEnumerator.cs
- HotSpotCollection.cs
- HttpStaticObjectsCollectionBase.cs
- EncoderParameter.cs
- ClaimTypes.cs
- CodePrimitiveExpression.cs
- RegionInfo.cs
- DesignerCategoryAttribute.cs
- IdentityHolder.cs
- XmlElementAttribute.cs
- NetTcpBindingElement.cs
- LinqDataSourceSelectEventArgs.cs
- MetricEntry.cs
- StorageAssociationTypeMapping.cs
- AsymmetricKeyExchangeDeformatter.cs
- CodeObject.cs
- Page.cs
- DBConcurrencyException.cs
- UrlAuthorizationModule.cs
- _LazyAsyncResult.cs
- ModelTypeConverter.cs
- GacUtil.cs
- FlowLayoutSettings.cs
- DatePicker.cs
- ListDictionary.cs
- DataGridViewAccessibleObject.cs
- HttpHandlerAction.cs
- ChainOfDependencies.cs
- SplashScreenNativeMethods.cs
- TraceXPathNavigator.cs
- ViewManager.cs
- DynamicAttribute.cs
- LabelTarget.cs
- CollectionViewGroupRoot.cs
- HMACMD5.cs
- ConstrainedDataObject.cs
- HtmlInputSubmit.cs
- ListControlConvertEventArgs.cs
- ResXBuildProvider.cs
- CharacterString.cs
- CacheForPrimitiveTypes.cs
- AdornerHitTestResult.cs
- DeclarativeCatalogPart.cs
- JavaScriptObjectDeserializer.cs
- DetailsViewInsertEventArgs.cs
- ReadOnlyDataSource.cs
- SystemUnicastIPAddressInformation.cs
- HTMLTextWriter.cs
- NameValuePair.cs
- ConditionalAttribute.cs
- PathFigure.cs
- TraceFilter.cs
- TabControlCancelEvent.cs
- StatusBar.cs
- graph.cs
- SymbolDocumentInfo.cs
- WSMessageEncoding.cs
- SQLByteStorage.cs
- Match.cs
- XmlILStorageConverter.cs
- DbBuffer.cs
- Mapping.cs