Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WhitespaceSignificantCollectionAttribute.cs
- MSAAWinEventWrap.cs
- StringAnimationBase.cs
- PathStreamGeometryContext.cs
- CompilerState.cs
- TableCellAutomationPeer.cs
- ExpressionPrefixAttribute.cs
- XmlWrappingReader.cs
- MailBnfHelper.cs
- XPathSelectionIterator.cs
- DetailsViewPagerRow.cs
- TransformerInfo.cs
- CatalogPartDesigner.cs
- Size3DValueSerializer.cs
- HtmlInputFile.cs
- PackWebRequestFactory.cs
- ObjectStateManager.cs
- JoinElimination.cs
- DefaultValueAttribute.cs
- Intellisense.cs
- ObjectTokenCategory.cs
- ChangeTracker.cs
- ActivityExecutionContext.cs
- InvokeMethodActivityDesigner.cs
- ThreadAbortException.cs
- InvalidOleVariantTypeException.cs
- DocumentSchemaValidator.cs
- SoapIncludeAttribute.cs
- SortableBindingList.cs
- TheQuery.cs
- ServerIdentity.cs
- BlurEffect.cs
- XmlNodeComparer.cs
- CompoundFileReference.cs
- TextSearch.cs
- HttpInputStream.cs
- ThicknessAnimationBase.cs
- BinarySerializer.cs
- InlineObject.cs
- ResourceBinder.cs
- Profiler.cs
- FolderBrowserDialog.cs
- Constant.cs
- FragmentQueryKB.cs
- HostedHttpRequestAsyncResult.cs
- LingerOption.cs
- BindingMemberInfo.cs
- Stylesheet.cs
- Trigger.cs
- ObjectTypeMapping.cs
- DataColumnMappingCollection.cs
- AliasedExpr.cs
- ContentPosition.cs
- odbcmetadatafactory.cs
- ViewStateModeByIdAttribute.cs
- DesignBindingValueUIHandler.cs
- ImageList.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- DesignSurfaceManager.cs
- SqlCommandBuilder.cs
- TimeSpanParse.cs
- RegexNode.cs
- TreeViewItemAutomationPeer.cs
- AnnotationHighlightLayer.cs
- FontResourceCache.cs
- SqlXml.cs
- _OSSOCK.cs
- CallbackValidatorAttribute.cs
- ContextStaticAttribute.cs
- RijndaelCryptoServiceProvider.cs
- Page.cs
- NavigationPropertyEmitter.cs
- CachedPathData.cs
- EntityDataSourceMemberPath.cs
- DashStyles.cs
- WriterOutput.cs
- NamedPipeHostedTransportConfiguration.cs
- ConstraintConverter.cs
- ModelTreeManager.cs
- DefinitionUpdate.cs
- JavaScriptObjectDeserializer.cs
- DoubleCollection.cs
- GcSettings.cs
- SchemaImporterExtensionsSection.cs
- FontUnitConverter.cs
- COM2AboutBoxPropertyDescriptor.cs
- CompilationSection.cs
- BaseParaClient.cs
- ScrollData.cs
- ParenthesizePropertyNameAttribute.cs
- LineSegment.cs
- TabControlAutomationPeer.cs
- InvokeMethodActivityDesigner.cs
- OleDbParameterCollection.cs
- HostingEnvironmentSection.cs
- PerfCounterSection.cs
- TargetPerspective.cs
- Vector3DCollectionConverter.cs
- XmlCodeExporter.cs
- EditingCommands.cs