Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- Pair.cs
- BindingSource.cs
- DeviceSpecificChoice.cs
- SqlComparer.cs
- SoapHeaderAttribute.cs
- Base64Decoder.cs
- AttributeEmitter.cs
- ToolBar.cs
- ResourcePool.cs
- SoapElementAttribute.cs
- DrawingContextWalker.cs
- SelectionEditingBehavior.cs
- EntityRecordInfo.cs
- PagesChangedEventArgs.cs
- ConstrainedDataObject.cs
- Atom10FeedFormatter.cs
- DefaultShape.cs
- XmlElement.cs
- RuleRef.cs
- OrderedDictionaryStateHelper.cs
- BindUriHelper.cs
- KeyedQueue.cs
- WebEventCodes.cs
- WorkflowQueue.cs
- EmptyStringExpandableObjectConverter.cs
- MiniLockedBorderGlyph.cs
- SignerInfo.cs
- ReservationCollection.cs
- SoapSchemaExporter.cs
- SurrogateEncoder.cs
- SQLBytesStorage.cs
- RelatedEnd.cs
- ObjectConverter.cs
- ObjectReaderCompiler.cs
- AQNBuilder.cs
- Point3DAnimation.cs
- DataPagerCommandEventArgs.cs
- CursorConverter.cs
- XPathSelectionIterator.cs
- ReflectionHelper.cs
- ColorConvertedBitmapExtension.cs
- EventKeyword.cs
- DelegateSerializationHolder.cs
- ReferentialConstraintRoleElement.cs
- RegisteredScript.cs
- CustomLineCap.cs
- _FtpDataStream.cs
- BitmapDownload.cs
- TemplateColumn.cs
- XmlRawWriterWrapper.cs
- FileAuthorizationModule.cs
- DesignParameter.cs
- XmlSignatureManifest.cs
- AnimationException.cs
- ListViewEditEventArgs.cs
- ObjectDataSourceView.cs
- ObjectListCommand.cs
- DbModificationClause.cs
- CodeCompileUnit.cs
- InitializerFacet.cs
- PointHitTestResult.cs
- mda.cs
- LabelLiteral.cs
- Metafile.cs
- Set.cs
- SID.cs
- Tool.cs
- FormsAuthenticationTicket.cs
- DebugInfoExpression.cs
- PageVisual.cs
- ApplicationFileCodeDomTreeGenerator.cs
- CheckBoxFlatAdapter.cs
- DataComponentGenerator.cs
- Filter.cs
- RectAnimation.cs
- DockProviderWrapper.cs
- RouteValueExpressionBuilder.cs
- ProfileSettings.cs
- UpdateExpressionVisitor.cs
- AssemblySettingAttributes.cs
- OrderedDictionary.cs
- UniqueConstraint.cs
- ToolStripItemEventArgs.cs
- TableHeaderCell.cs
- GridEntry.cs
- Point4D.cs
- HttpCachePolicy.cs
- DataGridViewLayoutData.cs
- QilIterator.cs
- PermissionSetEnumerator.cs
- ZoneIdentityPermission.cs
- SafeHandles.cs
- IgnoreFileBuildProvider.cs
- ToolStripItem.cs
- FormsAuthenticationCredentials.cs
- RuntimeConfig.cs
- SQLConvert.cs
- BitmapMetadataBlob.cs
- XmlSerializableServices.cs
- ChangePassword.cs