Code:
/ FX-1434 / FX-1434 / 1.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
- PrimitiveSchema.cs
- Rotation3DAnimation.cs
- ModifiableIteratorCollection.cs
- UIElementParaClient.cs
- DataSourceCacheDurationConverter.cs
- WinEventHandler.cs
- IisNotInstalledException.cs
- DataGridState.cs
- ValidationErrorCollection.cs
- SmtpFailedRecipientsException.cs
- RenderDataDrawingContext.cs
- SizeChangedEventArgs.cs
- StrokeNodeOperations2.cs
- PointAnimationUsingKeyFrames.cs
- TypeInfo.cs
- MergablePropertyAttribute.cs
- ListViewItemMouseHoverEvent.cs
- MarkupExtensionParser.cs
- SHA1Managed.cs
- RuntimeEnvironment.cs
- XmlElementElement.cs
- WebAdminConfigurationHelper.cs
- XmlAttributes.cs
- ClientScriptManagerWrapper.cs
- xsdvalidator.cs
- MsmqIntegrationSecurityMode.cs
- InternalTransaction.cs
- IriParsingElement.cs
- SQLDecimalStorage.cs
- RoutedEventConverter.cs
- SingleResultAttribute.cs
- ChannelManager.cs
- SimpleHandlerFactory.cs
- BitVector32.cs
- ComponentDesigner.cs
- TemplateBindingExpression.cs
- SafeNativeMethods.cs
- WebBrowserUriTypeConverter.cs
- ControlCodeDomSerializer.cs
- XPathItem.cs
- BuildProviderUtils.cs
- ContextStack.cs
- TypeLoadException.cs
- StringDictionary.cs
- ObjectResult.cs
- MatrixKeyFrameCollection.cs
- SQLInt64Storage.cs
- SelectingProviderEventArgs.cs
- ServiceModelEnumValidator.cs
- ApplicationInterop.cs
- InsufficientMemoryException.cs
- SqlDataSourceDesigner.cs
- TreeViewAutomationPeer.cs
- EllipseGeometry.cs
- DockPatternIdentifiers.cs
- Light.cs
- SqlConnectionHelper.cs
- HtmlEncodedRawTextWriter.cs
- Update.cs
- ListBindingConverter.cs
- DataGridViewLinkCell.cs
- XmlILIndex.cs
- StrokeNodeData.cs
- MailDefinition.cs
- XmlKeywords.cs
- AsymmetricKeyExchangeFormatter.cs
- Debug.cs
- WebServiceTypeData.cs
- PeerNameRecord.cs
- EngineSite.cs
- DynamicResourceExtension.cs
- ParameterBuilder.cs
- SqlUserDefinedAggregateAttribute.cs
- InvokeMemberBinder.cs
- RotationValidation.cs
- LiteralControl.cs
- UnsafeNativeMethods.cs
- VisualTarget.cs
- ConfigViewGenerator.cs
- UserPreferenceChangingEventArgs.cs
- AssemblySettingAttributes.cs
- CodeDOMUtility.cs
- URLMembershipCondition.cs
- BevelBitmapEffect.cs
- XsdCachingReader.cs
- ColumnMapCopier.cs
- MenuItem.cs
- SQLByte.cs
- ComContractElement.cs
- ActivityDesigner.cs
- Array.cs
- DataGridAddNewRow.cs
- xsdvalidator.cs
- SmtpAuthenticationManager.cs
- ConfigurationPermission.cs
- XslException.cs
- ByteFacetDescriptionElement.cs
- SplashScreen.cs
- ArcSegment.cs
- ChtmlTextWriter.cs