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
- EndEvent.cs
- TaiwanLunisolarCalendar.cs
- PropertyEmitterBase.cs
- CompoundFileDeflateTransform.cs
- DBConnectionString.cs
- WinFormsUtils.cs
- GridViewCancelEditEventArgs.cs
- SimpleBitVector32.cs
- FutureFactory.cs
- FacetValues.cs
- QuadraticBezierSegment.cs
- Completion.cs
- SmtpNtlmAuthenticationModule.cs
- DataGridViewRowEventArgs.cs
- NumericUpDownAcceleration.cs
- BinaryUtilClasses.cs
- UserPreferenceChangedEventArgs.cs
- CodeDirectoryCompiler.cs
- ContentElementCollection.cs
- HwndSourceParameters.cs
- ViewStateModeByIdAttribute.cs
- CryptoProvider.cs
- PrintPageEvent.cs
- HtmlButton.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- MiniConstructorInfo.cs
- HttpRawResponse.cs
- XmlMapping.cs
- codemethodreferenceexpression.cs
- CopyAttributesAction.cs
- DbConnectionPoolGroup.cs
- SelectionRangeConverter.cs
- WebCategoryAttribute.cs
- StorageComplexPropertyMapping.cs
- ControlBindingsConverter.cs
- XmlProcessingInstruction.cs
- TextDecorationUnitValidation.cs
- ValueUtilsSmi.cs
- EnvelopedPkcs7.cs
- OleDbWrapper.cs
- SafeReadContext.cs
- TextSpan.cs
- ImpersonationContext.cs
- TabPanel.cs
- WpfPayload.cs
- SpinLock.cs
- wgx_exports.cs
- IntSecurity.cs
- ComAdminWrapper.cs
- HtmlInputReset.cs
- EncodingInfo.cs
- OrderedDictionary.cs
- lengthconverter.cs
- ContextStack.cs
- ExpressionBindingCollection.cs
- Utils.cs
- DbgCompiler.cs
- WS2007FederationHttpBindingCollectionElement.cs
- HtmlHead.cs
- FontSource.cs
- CaseInsensitiveOrdinalStringComparer.cs
- DesignOnlyAttribute.cs
- SqlTypeSystemProvider.cs
- SessionEndingCancelEventArgs.cs
- SystemWebExtensionsSectionGroup.cs
- Component.cs
- ExpressionNode.cs
- FileDialog.cs
- ConnectionStringsSection.cs
- SiteMapSection.cs
- ResourceBinder.cs
- ControlParameter.cs
- TextParaClient.cs
- KeyTimeConverter.cs
- WeakReadOnlyCollection.cs
- OleDbPropertySetGuid.cs
- TypeDelegator.cs
- Converter.cs
- RemotingServices.cs
- _FixedSizeReader.cs
- HotSpotCollection.cs
- TextDecorations.cs
- GeometryHitTestResult.cs
- ToolStripRenderer.cs
- InitializationEventAttribute.cs
- Parallel.cs
- XhtmlBasicObjectListAdapter.cs
- LineInfo.cs
- TrustManager.cs
- GradientStop.cs
- ControlParameter.cs
- BmpBitmapEncoder.cs
- LabelLiteral.cs
- DocumentViewerHelper.cs
- EUCJPEncoding.cs
- DrawListViewSubItemEventArgs.cs
- Base64Encoder.cs
- EventDescriptorCollection.cs
- XmlValidatingReaderImpl.cs
- DrawItemEvent.cs