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
- Classification.cs
- TreeNodeBindingCollection.cs
- QueryOperationResponseOfT.cs
- XmlSchemaExternal.cs
- VariableQuery.cs
- WebPartMovingEventArgs.cs
- BitmapFrame.cs
- WebPageTraceListener.cs
- Utils.cs
- ConfigPathUtility.cs
- EntityViewContainer.cs
- CodeNamespaceImportCollection.cs
- OdbcConnectionStringbuilder.cs
- TextUtf8RawTextWriter.cs
- Buffer.cs
- Formatter.cs
- MSHTMLHost.cs
- SuppressIldasmAttribute.cs
- WebPartCloseVerb.cs
- RegexBoyerMoore.cs
- GroupByQueryOperator.cs
- tabpagecollectioneditor.cs
- Preprocessor.cs
- TextServicesCompartmentContext.cs
- BooleanFacetDescriptionElement.cs
- HyperLinkColumn.cs
- ListBindingConverter.cs
- DataBoundControlActionList.cs
- ObfuscationAttribute.cs
- DataSourceControl.cs
- SettingsSavedEventArgs.cs
- ObjectStateManagerMetadata.cs
- TextSelectionHelper.cs
- TargetPerspective.cs
- ManagementScope.cs
- LabelLiteral.cs
- DoubleMinMaxAggregationOperator.cs
- DataGridViewRowStateChangedEventArgs.cs
- Rect3DConverter.cs
- HandoffBehavior.cs
- DataGridPagingPage.cs
- DropShadowEffect.cs
- HostProtectionPermission.cs
- TypeConverterAttribute.cs
- SelectionEditor.cs
- QueryRelOp.cs
- CustomErrorCollection.cs
- RegistryPermission.cs
- ContainerTracking.cs
- WebPartVerbsEventArgs.cs
- AssertSection.cs
- HashSetEqualityComparer.cs
- SpeechSeg.cs
- ConfigurationSectionGroup.cs
- XmlSortKey.cs
- Events.cs
- FixedTextPointer.cs
- CryptoApi.cs
- SpecialFolderEnumConverter.cs
- Rect3D.cs
- TerminatorSinks.cs
- LeaseManager.cs
- NonSerializedAttribute.cs
- GuidConverter.cs
- Vector3DKeyFrameCollection.cs
- SimpleMailWebEventProvider.cs
- XmlExtensionFunction.cs
- SvcMapFileSerializer.cs
- BaseDataBoundControl.cs
- FormsAuthenticationUser.cs
- BaseTreeIterator.cs
- ScaleTransform.cs
- MissingMemberException.cs
- Column.cs
- Vector3dCollection.cs
- BindingExpressionBase.cs
- CryptoStream.cs
- SubtreeProcessor.cs
- HttpCachePolicy.cs
- Operand.cs
- FixedTextContainer.cs
- WebPartMinimizeVerb.cs
- StateDesigner.CommentLayoutGlyph.cs
- BreakSafeBase.cs
- SspiWrapper.cs
- SerializationObjectManager.cs
- SqlConnectionFactory.cs
- RequestCacheManager.cs
- DataObjectPastingEventArgs.cs
- File.cs
- ProfileInfo.cs
- TypeLibConverter.cs
- SQLMembershipProvider.cs
- DoubleLinkListEnumerator.cs
- UnionExpr.cs
- prefixendpointaddressmessagefiltertable.cs
- Form.cs
- ObjectTag.cs
- DataGridViewAddColumnDialog.cs
- BatchStream.cs