Code:
/ DotNET / DotNET / 8.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
- CodeCompileUnit.cs
- HttpWriter.cs
- CompressedStack.cs
- CodeCompiler.cs
- CounterCreationData.cs
- Classification.cs
- Comparer.cs
- StickyNote.cs
- ITextView.cs
- SchemaTypeEmitter.cs
- RangeBase.cs
- XmlSortKey.cs
- ProfileInfo.cs
- Mappings.cs
- BamlResourceContent.cs
- XmlDataLoader.cs
- WindowVisualStateTracker.cs
- KeyboardNavigation.cs
- ArgumentOutOfRangeException.cs
- DictionaryKeyPropertyAttribute.cs
- TextPattern.cs
- LinqDataSourceStatusEventArgs.cs
- NumberFormatInfo.cs
- PartBasedPackageProperties.cs
- EdmSchemaAttribute.cs
- EventLogLink.cs
- MulticastOption.cs
- XmlCustomFormatter.cs
- WebPartVerbCollection.cs
- PlainXmlWriter.cs
- loginstatus.cs
- DataListCommandEventArgs.cs
- TraceUtils.cs
- XmlHelper.cs
- ImageSourceValueSerializer.cs
- ResourceReferenceKeyNotFoundException.cs
- InfoCardServiceInstallComponent.cs
- ColorPalette.cs
- Pointer.cs
- ReservationNotFoundException.cs
- StylusSystemGestureEventArgs.cs
- ListViewDeletedEventArgs.cs
- BuildProvidersCompiler.cs
- WorkflowInlining.cs
- MediaTimeline.cs
- EdmSchemaError.cs
- UIElement.cs
- ListComponentEditor.cs
- ReadOnlyDictionary.cs
- InlinedAggregationOperatorEnumerator.cs
- EntityDataSourceColumn.cs
- LinearGradientBrush.cs
- SubpageParaClient.cs
- TableDetailsRow.cs
- LinkedDataMemberFieldEditor.cs
- DataGridViewSortCompareEventArgs.cs
- ConnectivityStatus.cs
- IRCollection.cs
- GraphicsContainer.cs
- ActivityTypeDesigner.xaml.cs
- EasingQuaternionKeyFrame.cs
- DefaultValueAttribute.cs
- EntityCommandDefinition.cs
- ListViewItem.cs
- GradientBrush.cs
- UrlEncodedParameterWriter.cs
- LayoutSettings.cs
- Action.cs
- NetworkStream.cs
- KeyTime.cs
- Internal.cs
- NumericUpDown.cs
- ToolStripItemImageRenderEventArgs.cs
- AuditLevel.cs
- VideoDrawing.cs
- Missing.cs
- PersonalizablePropertyEntry.cs
- WebDescriptionAttribute.cs
- ZipIOLocalFileHeader.cs
- ListViewGroupItemCollection.cs
- _FtpDataStream.cs
- ClientRequest.cs
- LazyLoadBehavior.cs
- FrameworkPropertyMetadata.cs
- Cursors.cs
- DBPropSet.cs
- RecommendedAsConfigurableAttribute.cs
- dataprotectionpermissionattribute.cs
- DocComment.cs
- HttpsHostedTransportConfiguration.cs
- Monitor.cs
- DateTimePickerDesigner.cs
- TextBoxLine.cs
- BitmapCacheBrush.cs
- InteropEnvironment.cs
- ToolboxBitmapAttribute.cs
- DefaultWorkflowLoaderService.cs
- SolidColorBrush.cs
- WebCategoryAttribute.cs
- HasCopySemanticsAttribute.cs