Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Data / System / Data / PrimaryKeyTypeConverter.cs / 1 / 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. //------------------------------------------------------------------------------ //// 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
- PartitionedDataSource.cs
- FontFaceLayoutInfo.cs
- ContextDataSource.cs
- HostProtectionException.cs
- ReadOnlyHierarchicalDataSource.cs
- SafeProcessHandle.cs
- WebPartMinimizeVerb.cs
- HotSpot.cs
- NavigatorOutput.cs
- DesignerAttribute.cs
- ToolStripTextBox.cs
- DisplayInformation.cs
- DashStyle.cs
- UnSafeCharBuffer.cs
- DataGridViewTopRowAccessibleObject.cs
- StringArrayConverter.cs
- Thread.cs
- MimeWriter.cs
- x509utils.cs
- WebPartVerbsEventArgs.cs
- SimpleBitVector32.cs
- ImmutableCollection.cs
- MatrixAnimationUsingKeyFrames.cs
- RSACryptoServiceProvider.cs
- ClaimTypeElementCollection.cs
- IndexedString.cs
- AuthenticationManager.cs
- ConfigXmlComment.cs
- CacheAxisQuery.cs
- ArgumentException.cs
- Vector3DConverter.cs
- NavigationWindow.cs
- ForwardPositionQuery.cs
- BufferBuilder.cs
- SafeFileMapViewHandle.cs
- ControlDesignerState.cs
- PolyLineSegment.cs
- CanonicalXml.cs
- SharedPersonalizationStateInfo.cs
- MultiPropertyDescriptorGridEntry.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ProxyHelper.cs
- ListViewItemMouseHoverEvent.cs
- SecurityException.cs
- CompressionTracing.cs
- ContainerParagraph.cs
- FontStretchConverter.cs
- isolationinterop.cs
- TraceAsyncResult.cs
- EncryptedPackageFilter.cs
- DBCommand.cs
- ProxySimple.cs
- ImageSource.cs
- FrameworkElementFactoryMarkupObject.cs
- ServiceNameElement.cs
- ThemeDirectoryCompiler.cs
- DoubleAnimation.cs
- VisualStateManager.cs
- MetabaseReader.cs
- ExceptionValidationRule.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- FixedSOMImage.cs
- Attributes.cs
- DecimalConstantAttribute.cs
- SqlUdtInfo.cs
- WindowsToolbar.cs
- TypeElement.cs
- CfgSemanticTag.cs
- WebBrowserUriTypeConverter.cs
- TabControlEvent.cs
- ItemsControlAutomationPeer.cs
- SemaphoreSlim.cs
- ZoomPercentageConverter.cs
- ScalarConstant.cs
- ConfigXmlWhitespace.cs
- CompilationUtil.cs
- UnsafeNativeMethods.cs
- EntityTemplateUserControl.cs
- RightsManagementPermission.cs
- GlyphingCache.cs
- GZipStream.cs
- RoleBoolean.cs
- ArgIterator.cs
- XmlWriter.cs
- _NetRes.cs
- RawStylusInputCustomData.cs
- JulianCalendar.cs
- wgx_commands.cs
- DrawTreeNodeEventArgs.cs
- IDispatchConstantAttribute.cs
- ComponentGuaranteesAttribute.cs
- TextCompositionManager.cs
- HwndSourceKeyboardInputSite.cs
- _AutoWebProxyScriptWrapper.cs
- SiteMapNodeItem.cs
- BamlResourceSerializer.cs
- dataprotectionpermissionattribute.cs
- CompiledRegexRunner.cs
- ParentQuery.cs
- Button.cs