Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewCellConverter.cs / 1 / DataGridViewCellConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms { using System; using System.Windows.Forms; using System.Globalization; using System.ComponentModel; using System.Reflection; using System.Runtime.Serialization.Formatters; using System.ComponentModel.Design.Serialization; // used by the designer to serialize the DataGridViewCell class internal class DataGridViewCellConverter : ExpandableObjectConverter { public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(InstanceDescriptor)) { 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"); } DataGridViewCell cell = value as DataGridViewCell; if (destinationType == typeof(InstanceDescriptor) && cell != null) { ConstructorInfo ctor = cell.GetType().GetConstructor(new Type[0]); if (ctor != null) { return new InstanceDescriptor(ctor, new object[0], false); } } 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
- MasterPage.cs
- ApplyHostConfigurationBehavior.cs
- Parameter.cs
- QilInvokeEarlyBound.cs
- SoapDocumentServiceAttribute.cs
- ExpressionBinding.cs
- DashStyle.cs
- StylusPointProperties.cs
- RightsDocument.cs
- Mapping.cs
- SendContent.cs
- XmlSchemaCompilationSettings.cs
- ScalarType.cs
- StreamAsIStream.cs
- SizeKeyFrameCollection.cs
- UnknownBitmapEncoder.cs
- ApplicationHost.cs
- UdpTransportBindingElement.cs
- EllipseGeometry.cs
- DrawingImage.cs
- MachineKeyConverter.cs
- COM2PictureConverter.cs
- ProfileSettingsCollection.cs
- VisualTreeUtils.cs
- SafeCryptoHandles.cs
- TraceListeners.cs
- X509Extension.cs
- _NegoStream.cs
- Int32CAMarshaler.cs
- TiffBitmapEncoder.cs
- DBParameter.cs
- CacheChildrenQuery.cs
- ChannelPoolSettings.cs
- MessageEventSubscriptionService.cs
- InheritanceContextChangedEventManager.cs
- codemethodreferenceexpression.cs
- AffineTransform3D.cs
- GeneralTransform3DTo2DTo3D.cs
- CaseInsensitiveComparer.cs
- TextEditorCharacters.cs
- _NativeSSPI.cs
- CompensatableTransactionScopeActivityDesigner.cs
- ConstantExpression.cs
- SiteMapDesignerDataSourceView.cs
- RemoteWebConfigurationHostStream.cs
- StaticExtension.cs
- System.Data_BID.cs
- ExternalCalls.cs
- ServiceBehaviorElementCollection.cs
- DataGridViewAutoSizeModeEventArgs.cs
- ZoneMembershipCondition.cs
- InputScopeNameConverter.cs
- JournalEntry.cs
- FilterRepeater.cs
- StandardTransformFactory.cs
- SafeFileMapViewHandle.cs
- DataSourceCollectionBase.cs
- SQLInt32.cs
- SspiWrapper.cs
- SelectionProcessor.cs
- FontFamily.cs
- SHA1Managed.cs
- Substitution.cs
- AspNetSynchronizationContext.cs
- InstanceDataCollectionCollection.cs
- TimelineGroup.cs
- PerformanceCounterPermissionAttribute.cs
- OleDbConnectionInternal.cs
- DataListItemCollection.cs
- PropertyIDSet.cs
- UnauthorizedWebPart.cs
- SQLInt32.cs
- ShapingWorkspace.cs
- TextSchema.cs
- DataGridCheckBoxColumn.cs
- EntityReference.cs
- RotateTransform3D.cs
- ImageSource.cs
- HtmlProps.cs
- RequestChannel.cs
- TreeView.cs
- Label.cs
- ScalarConstant.cs
- KeysConverter.cs
- MailWriter.cs
- BindingValueChangedEventArgs.cs
- GeometryGroup.cs
- WebPartCloseVerb.cs
- RpcCryptoContext.cs
- IApplicationTrustManager.cs
- ResourceManagerWrapper.cs
- HybridDictionary.cs
- FrameworkContentElementAutomationPeer.cs
- FolderLevelBuildProvider.cs
- BasicHttpSecurityElement.cs
- StylusButtonCollection.cs
- CommonDialog.cs
- Columns.cs
- RequestQueue.cs
- WebExceptionStatus.cs