Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / PrimaryKeyTypeConverter.cs / 1305376 / PrimaryKeyTypeConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data { using System.ComponentModel; using System.Globalization; using System.Data; internal sealed class PrimaryKeyTypeConverter : ReferenceConverter { // converter classes should have public ctor public PrimaryKeyTypeConverter() : base(typeof(DataColumn[])) { } public override bool GetPropertiesSupported(ITypeDescriptorContext context) { return false; } public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(String)) { return true; } return base.CanConvertTo(context, destinationType); } public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == null) { throw new ArgumentNullException("destinationType"); } if (destinationType == typeof(string)) { return (new DataColumn[] {}).GetType().Name; } 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
- FormViewCommandEventArgs.cs
- IdnMapping.cs
- AdornerHitTestResult.cs
- StrongNameSignatureInformation.cs
- GroupBoxRenderer.cs
- FrameDimension.cs
- UrlMappingsSection.cs
- DecoderFallback.cs
- assertwrapper.cs
- DataChangedEventManager.cs
- EditorAttributeInfo.cs
- _HTTPDateParse.cs
- RawStylusActions.cs
- assertwrapper.cs
- ThicknessKeyFrameCollection.cs
- SchemaObjectWriter.cs
- TextEmbeddedObject.cs
- Freezable.cs
- SqlTypeConverter.cs
- ProtocolElement.cs
- MaxValueConverter.cs
- TreeViewTemplateSelector.cs
- SHA1.cs
- COM2IPerPropertyBrowsingHandler.cs
- Speller.cs
- _CacheStreams.cs
- SafeMILHandleMemoryPressure.cs
- OleDbReferenceCollection.cs
- BindingContext.cs
- ByteKeyFrameCollection.cs
- StorageEntityContainerMapping.cs
- CheckableControlBaseAdapter.cs
- Brushes.cs
- AuthenticationServiceManager.cs
- RuntimeHelpers.cs
- FixedSOMPage.cs
- ThreadStateException.cs
- HtmlProps.cs
- HandlerWithFactory.cs
- NavigationCommands.cs
- Misc.cs
- Style.cs
- FilterElement.cs
- DragStartedEventArgs.cs
- GC.cs
- SerializationStore.cs
- TreeNodeEventArgs.cs
- KeyEvent.cs
- CommandExpr.cs
- ConstructorArgumentAttribute.cs
- Columns.cs
- PathGradientBrush.cs
- FrameworkContentElement.cs
- CngAlgorithmGroup.cs
- ClassHandlersStore.cs
- MenuDesigner.cs
- SqlStatistics.cs
- IntSecurity.cs
- SQLInt16Storage.cs
- DefinitionUpdate.cs
- WebResourceUtil.cs
- XamlTypeWithExplicitNamespace.cs
- CollectionBuilder.cs
- ListViewGroup.cs
- Bidi.cs
- ObjectQuery.cs
- ListSortDescriptionCollection.cs
- ExternalException.cs
- DataGridRowAutomationPeer.cs
- TraceRecords.cs
- SubpageParaClient.cs
- LinkLabel.cs
- ListControl.cs
- SqlCacheDependencyDatabase.cs
- CodeSnippetExpression.cs
- GlyphTypeface.cs
- UnionCqlBlock.cs
- Viewport2DVisual3D.cs
- KeyInfo.cs
- SpecialFolderEnumConverter.cs
- ArraySortHelper.cs
- TableItemStyle.cs
- BlurEffect.cs
- SimpleApplicationHost.cs
- TimeSpanParse.cs
- MobileControlsSection.cs
- EncoderNLS.cs
- safesecurityhelperavalon.cs
- StringSource.cs
- XPathEmptyIterator.cs
- ReverseInheritProperty.cs
- Parsers.cs
- ProcessHostFactoryHelper.cs
- ContentFilePart.cs
- DataGridHeaderBorder.cs
- TableLayoutPanelDesigner.cs
- TransactionFilter.cs
- XmlDocument.cs
- SelectingProviderEventArgs.cs
- SqlClientWrapperSmiStreamChars.cs