Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewRowConverter.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RsaSecurityKey.cs
- CollectionView.cs
- FixedSOMLineRanges.cs
- MultiplexingFormatMapping.cs
- Model3D.cs
- MDIControlStrip.cs
- LicenseManager.cs
- InfoCardMasterKey.cs
- ArglessEventHandlerProxy.cs
- XPathSelectionIterator.cs
- CopyCodeAction.cs
- SystemWebSectionGroup.cs
- X509Utils.cs
- TimeSpanOrInfiniteConverter.cs
- _ConnectStream.cs
- RawKeyboardInputReport.cs
- TextBox.cs
- ArgumentException.cs
- NativeActivityMetadata.cs
- OracleNumber.cs
- ErrorHandler.cs
- TcpProcessProtocolHandler.cs
- CharKeyFrameCollection.cs
- GatewayDefinition.cs
- VoiceObjectToken.cs
- OdbcHandle.cs
- Byte.cs
- OdbcConnectionFactory.cs
- X509CertificateCollection.cs
- Geometry.cs
- RepeatButton.cs
- OleDbException.cs
- PropertyStore.cs
- ImageAttributes.cs
- ConditionalDesigner.cs
- TextElementCollection.cs
- IDReferencePropertyAttribute.cs
- XsdBuildProvider.cs
- TCPListener.cs
- HostSecurityManager.cs
- RegexGroupCollection.cs
- OperationAbortedException.cs
- DocumentReferenceCollection.cs
- RenderOptions.cs
- EventHandlingScope.cs
- WebPartTracker.cs
- WindowInteropHelper.cs
- Knowncolors.cs
- NullableConverter.cs
- ProvideValueServiceProvider.cs
- CacheSection.cs
- CustomCategoryAttribute.cs
- DataListCommandEventArgs.cs
- RuntimeConfig.cs
- TextViewSelectionProcessor.cs
- DataGridAddNewRow.cs
- OrderedDictionaryStateHelper.cs
- CommandConverter.cs
- EditorBrowsableAttribute.cs
- assertwrapper.cs
- DelegatingTypeDescriptionProvider.cs
- FormViewPagerRow.cs
- ListGeneralPage.cs
- HMACSHA512.cs
- DllNotFoundException.cs
- XDRSchema.cs
- EntityDataSourceSelectedEventArgs.cs
- EventWaitHandleSecurity.cs
- PingReply.cs
- MenuBase.cs
- COM2AboutBoxPropertyDescriptor.cs
- RootBrowserWindow.cs
- UnionExpr.cs
- VectorCollectionConverter.cs
- SurrogateSelector.cs
- XomlCompiler.cs
- UxThemeWrapper.cs
- CultureTable.cs
- DbConnectionInternal.cs
- OpenTypeLayoutCache.cs
- VBCodeProvider.cs
- ScriptingSectionGroup.cs
- FixedStringLookup.cs
- HttpWebRequest.cs
- Activity.cs
- AmbientValueAttribute.cs
- NetworkAddressChange.cs
- BufferAllocator.cs
- BitmapEffectGroup.cs
- UrlPath.cs
- BitmapEffectDrawing.cs
- DataGridItemAttachedStorage.cs
- IntSecurity.cs
- X509DefaultServiceCertificateElement.cs
- SqlClientWrapperSmiStream.cs
- ExplicitDiscriminatorMap.cs
- LocalFileSettingsProvider.cs
- FontInfo.cs
- Rijndael.cs
- HtmlImage.cs