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
- XmlUnspecifiedAttribute.cs
- XmlTextReader.cs
- RecordManager.cs
- HMACSHA384.cs
- ExclusiveCanonicalizationTransform.cs
- StructuralCache.cs
- LinqDataSourceDisposeEventArgs.cs
- HttpWebRequest.cs
- SqlTrackingWorkflowInstance.cs
- VirtualDirectoryMapping.cs
- SamlEvidence.cs
- ReachDocumentPageSerializer.cs
- GridViewColumnHeaderAutomationPeer.cs
- UserControlCodeDomTreeGenerator.cs
- CodeTypeConstructor.cs
- SendDesigner.xaml.cs
- DataColumnCollection.cs
- CssClassPropertyAttribute.cs
- UInt32Storage.cs
- RectangleGeometry.cs
- RNGCryptoServiceProvider.cs
- CommandManager.cs
- TextRangeEditTables.cs
- IntPtr.cs
- WebPartMinimizeVerb.cs
- StrokeNodeOperations2.cs
- ReversePositionQuery.cs
- HScrollBar.cs
- CheckableControlBaseAdapter.cs
- BasicExpressionVisitor.cs
- SurrogateSelector.cs
- DataGridViewHeaderCell.cs
- SafeHandles.cs
- TraceShell.cs
- MethodBuilderInstantiation.cs
- SystemResources.cs
- HttpWebRequest.cs
- BamlLocalizer.cs
- Matrix3DConverter.cs
- ContentPresenter.cs
- SchemaDeclBase.cs
- IUnknownConstantAttribute.cs
- ObservableCollection.cs
- SystemColors.cs
- GroupByExpressionRewriter.cs
- ScalarOps.cs
- DetailsViewInsertEventArgs.cs
- BindingElementCollection.cs
- SqlIdentifier.cs
- VirtualizedContainerService.cs
- BlurEffect.cs
- MachineKeyConverter.cs
- NamespaceList.cs
- Point4D.cs
- XmlSchemaFacet.cs
- ObjectMaterializedEventArgs.cs
- SingleAnimation.cs
- EndpointAddressMessageFilterTable.cs
- KnownBoxes.cs
- WebPartManager.cs
- DataReaderContainer.cs
- CertificateElement.cs
- DataGridRowHeaderAutomationPeer.cs
- SafeReversePInvokeHandle.cs
- XmlSchemaNotation.cs
- ConfigurationProviderException.cs
- DigestTraceRecordHelper.cs
- InkCanvasFeedbackAdorner.cs
- ResourceDictionary.cs
- PermissionRequestEvidence.cs
- SocketAddress.cs
- UInt32Converter.cs
- AffineTransform3D.cs
- ExpressionVisitor.cs
- FormsAuthentication.cs
- SecurityTokenSerializer.cs
- EdmEntityTypeAttribute.cs
- CollectionType.cs
- _ProxyRegBlob.cs
- LookupNode.cs
- AuthenticationModuleElement.cs
- DataGridViewComboBoxEditingControl.cs
- WindowsMenu.cs
- HwndHost.cs
- COM2PictureConverter.cs
- DataContractSerializerOperationFormatter.cs
- Int32KeyFrameCollection.cs
- complextypematerializer.cs
- HttpCookieCollection.cs
- DesignerActionUIStateChangeEventArgs.cs
- MsmqMessageSerializationFormat.cs
- CodeCatchClauseCollection.cs
- MDIControlStrip.cs
- ObjectCache.cs
- DesignerDataView.cs
- NativeBuffer.cs
- RegisteredHiddenField.cs
- WmlTextBoxAdapter.cs
- AbstractSvcMapFileLoader.cs
- GuidelineCollection.cs