Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewRowConverter.cs / 1 / DataGridViewRowConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Windows.Forms { using System.Runtime.Serialization.Formatters; using System.Runtime.Remoting; using System.Runtime.InteropServices; using Microsoft.Win32; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Drawing; using System.Diagnostics; using System.Globalization; using System.Reflection; internal class DataGridViewRowConverter : ExpandableObjectConverter { public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(InstanceDescriptor)) { return true; } return base.CanConvertTo(context, destinationType); } ////// Converts the given object to another type. The most common types to convert /// are to and from a string object. The default implementation will make a call /// to ToString on the object if the object is valid and if the destination /// type is string. If this cannot convert to the desitnation type, this will /// throw a NotSupportedException. /// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == null) { throw new ArgumentNullException("destinationType"); } DataGridViewRow dataGridViewRow = value as DataGridViewRow; if (destinationType == typeof(InstanceDescriptor) && dataGridViewRow != null) { // public DataGridViewRow() // ConstructorInfo ctor = dataGridViewRow.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
- ReaderWriterLock.cs
- ListViewGroup.cs
- EntityCommand.cs
- FormCollection.cs
- SqlWebEventProvider.cs
- XmlSchemaInferenceException.cs
- XmlException.cs
- DockingAttribute.cs
- GetCertificateRequest.cs
- ExpressionNode.cs
- WebPartManagerInternals.cs
- JsonEncodingStreamWrapper.cs
- DataGridState.cs
- WebPartConnectionsCancelVerb.cs
- TemplateContainer.cs
- EntityContainerEntitySet.cs
- StateChangeEvent.cs
- DataRow.cs
- SHA512.cs
- Assert.cs
- Int32CollectionConverter.cs
- AssignDesigner.xaml.cs
- HttpResponseInternalWrapper.cs
- RuntimeCompatibilityAttribute.cs
- CryptoHandle.cs
- FormViewUpdateEventArgs.cs
- NamedPipeWorkerProcess.cs
- ProxySimple.cs
- PropertyItemInternal.cs
- wmiprovider.cs
- TaskFileService.cs
- PasswordRecovery.cs
- DescendantBaseQuery.cs
- wgx_render.cs
- SingleAnimationUsingKeyFrames.cs
- ScriptManagerProxy.cs
- CompiledIdentityConstraint.cs
- ipaddressinformationcollection.cs
- URLAttribute.cs
- GPPOINT.cs
- Quad.cs
- ListViewCancelEventArgs.cs
- DocumentViewerAutomationPeer.cs
- Compiler.cs
- CatalogPartCollection.cs
- XsltConvert.cs
- OSFeature.cs
- StringComparer.cs
- Point.cs
- SymLanguageVendor.cs
- Itemizer.cs
- XPathDocument.cs
- Exceptions.cs
- AsymmetricCryptoHandle.cs
- ProfileProvider.cs
- ObservableDictionary.cs
- PartialArray.cs
- CryptoKeySecurity.cs
- Int64Storage.cs
- DummyDataSource.cs
- ExpressionNode.cs
- WindowsBrush.cs
- TextLine.cs
- Effect.cs
- ErrorStyle.cs
- CommandCollectionEditor.cs
- Attributes.cs
- FrameworkContentElement.cs
- TabControl.cs
- AttributeXamlType.cs
- ToolZoneDesigner.cs
- CatalogPartChrome.cs
- DesignerTextWriter.cs
- PathGeometry.cs
- sqlnorm.cs
- IISUnsafeMethods.cs
- SecurityContextSecurityTokenResolver.cs
- DesignerTransaction.cs
- PasswordDeriveBytes.cs
- NeutralResourcesLanguageAttribute.cs
- Matrix3D.cs
- DetailsViewPagerRow.cs
- WebPartUserCapability.cs
- oledbconnectionstring.cs
- DiffuseMaterial.cs
- WebPartsPersonalizationAuthorization.cs
- ImageListImage.cs
- ReferencedType.cs
- DataBoundControlAdapter.cs
- cookie.cs
- LinkConverter.cs
- HighContrastHelper.cs
- DateTimeConstantAttribute.cs
- XmlWrappingWriter.cs
- CssClassPropertyAttribute.cs
- StateMachineSubscription.cs
- NativeActivityFaultContext.cs
- ChannelPoolSettings.cs
- CallId.cs
- DataRelation.cs