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
- DatasetMethodGenerator.cs
- ContentPresenter.cs
- RegexWriter.cs
- LambdaCompiler.Address.cs
- RadioButton.cs
- DataGridRow.cs
- Part.cs
- BevelBitmapEffect.cs
- SpellerInterop.cs
- EventListenerClientSide.cs
- Error.cs
- ClusterRegistryConfigurationProvider.cs
- ResourceSet.cs
- DetailsViewPagerRow.cs
- ColumnMapVisitor.cs
- IdentityModelDictionary.cs
- SqlConnectionPoolProviderInfo.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- SerialPinChanges.cs
- DBPropSet.cs
- EventHandlersStore.cs
- NonParentingControl.cs
- SafeFileMappingHandle.cs
- EntityKeyElement.cs
- CustomWebEventKey.cs
- ScrollItemPattern.cs
- FlowLayout.cs
- CheckableControlBaseAdapter.cs
- HasRunnableWorkflowEvent.cs
- CryptoHandle.cs
- AmbientLight.cs
- DateBoldEvent.cs
- ListBindingHelper.cs
- documentsequencetextview.cs
- PtsHost.cs
- UserControlCodeDomTreeGenerator.cs
- ValidationErrorEventArgs.cs
- MobileErrorInfo.cs
- TextRangeEditTables.cs
- CellLabel.cs
- KeyEvent.cs
- AppDomainCompilerProxy.cs
- GetPageNumberCompletedEventArgs.cs
- PointAnimationUsingKeyFrames.cs
- PkcsUtils.cs
- ManagedWndProcTracker.cs
- CachedPathData.cs
- MachineKeySection.cs
- ThreadPool.cs
- CodeParameterDeclarationExpression.cs
- DoubleAverageAggregationOperator.cs
- ToolStripDropDownItemDesigner.cs
- WmpBitmapEncoder.cs
- InkCanvasSelectionAdorner.cs
- ExpandSegmentCollection.cs
- StyleCollectionEditor.cs
- ProfileSection.cs
- DataSourceListEditor.cs
- AliasedSlot.cs
- FontSourceCollection.cs
- FieldCollectionEditor.cs
- DocumentApplicationJournalEntryEventArgs.cs
- CSharpCodeProvider.cs
- RepeaterCommandEventArgs.cs
- MetadataSection.cs
- ByteStream.cs
- GridToolTip.cs
- Crc32Helper.cs
- DetailsViewPageEventArgs.cs
- XmlSchemaChoice.cs
- SoapFaultCodes.cs
- QilInvokeLateBound.cs
- BindingCompleteEventArgs.cs
- CryptoStream.cs
- ComplexTypeEmitter.cs
- BindingValueChangedEventArgs.cs
- Help.cs
- CodeDOMProvider.cs
- ExpressionDumper.cs
- Number.cs
- NetworkStream.cs
- SHA256Managed.cs
- CqlLexer.cs
- Operator.cs
- ProfileServiceManager.cs
- Path.cs
- RoutedEventValueSerializer.cs
- Encoder.cs
- QilChoice.cs
- EncoderExceptionFallback.cs
- WarningException.cs
- prompt.cs
- PassportAuthenticationModule.cs
- IdleTimeoutMonitor.cs
- TemplateControlBuildProvider.cs
- BinHexDecoder.cs
- Rectangle.cs
- WebBaseEventKeyComparer.cs
- ObjectStateEntry.cs
- DelegatingConfigHost.cs