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
- Bezier.cs
- SemaphoreFullException.cs
- DeviceContext.cs
- PageParser.cs
- ReadContentAsBinaryHelper.cs
- TextBoxBase.cs
- ActivityInstanceReference.cs
- CodeCommentStatement.cs
- CreateUserWizard.cs
- RoutingEndpointTrait.cs
- SecurityCookieModeValidator.cs
- SchemaNames.cs
- RemoteWebConfigurationHost.cs
- XamlStream.cs
- DropDownButton.cs
- TraceContext.cs
- xmlsaver.cs
- ImportContext.cs
- LogPolicy.cs
- DataGridBoolColumn.cs
- CalendarData.cs
- PhotoPrintingIntent.cs
- KeyConverter.cs
- StateWorkerRequest.cs
- InheritedPropertyChangedEventArgs.cs
- SchemaEntity.cs
- CodeMemberEvent.cs
- PermissionSetEnumerator.cs
- LockRecoveryTask.cs
- HttpHandlersSection.cs
- DeclarationUpdate.cs
- ScrollData.cs
- MenuItem.cs
- ExponentialEase.cs
- DatePickerTextBox.cs
- LogicalExpr.cs
- Image.cs
- FieldDescriptor.cs
- DataGridState.cs
- EntityDataSourceWrapper.cs
- TextRangeEdit.cs
- ThousandthOfEmRealPoints.cs
- NullableDoubleAverageAggregationOperator.cs
- EntityStoreSchemaGenerator.cs
- Italic.cs
- SpeechSynthesizer.cs
- OpCellTreeNode.cs
- InkCanvasSelection.cs
- ContextMenuStripGroupCollection.cs
- PDBReader.cs
- ClientSponsor.cs
- HtmlInputCheckBox.cs
- Viewport2DVisual3D.cs
- ConfigurationSectionGroupCollection.cs
- MenuBase.cs
- unsafeIndexingFilterStream.cs
- StorageEntitySetMapping.cs
- DbTransaction.cs
- Internal.cs
- SingleStorage.cs
- HealthMonitoringSection.cs
- TimeStampChecker.cs
- BrowserCapabilitiesFactory.cs
- __Filters.cs
- OleDbTransaction.cs
- HtmlTableRowCollection.cs
- OptimizerPatterns.cs
- WindowsFormsSynchronizationContext.cs
- DataGridViewCellStyleChangedEventArgs.cs
- loginstatus.cs
- SolidBrush.cs
- ExtensibleClassFactory.cs
- DocumentSequence.cs
- ArraySubsetEnumerator.cs
- TouchPoint.cs
- RoutedCommand.cs
- HyperLinkDataBindingHandler.cs
- ManualResetEvent.cs
- UInt64Converter.cs
- DesignerToolStripControlHost.cs
- RuntimeArgumentHandle.cs
- CustomTrackingQuery.cs
- CustomErrorsSectionWrapper.cs
- ClonableStack.cs
- AspNetRouteServiceHttpHandler.cs
- UnsafeNativeMethods.cs
- AuthenticationService.cs
- SelectionProviderWrapper.cs
- IncrementalReadDecoders.cs
- ZipIOExtraFieldElement.cs
- StylusShape.cs
- NameNode.cs
- CryptoApi.cs
- EnumUnknown.cs
- DesignerActionList.cs
- SchemaTableColumn.cs
- TemplatedAdorner.cs
- AbstractDataSvcMapFileLoader.cs
- AssemblyCache.cs
- Array.cs