Code:
/ DotNET / DotNET / 8.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
- ViewManager.cs
- XPathNodePointer.cs
- HostingEnvironmentSection.cs
- AlphaSortedEnumConverter.cs
- DllNotFoundException.cs
- Interlocked.cs
- DataServiceStreamResponse.cs
- HtmlControlAdapter.cs
- documentsequencetextview.cs
- AtomMaterializer.cs
- AnnouncementClient.cs
- CodeAttributeArgumentCollection.cs
- FixedSOMPageConstructor.cs
- OptimizerPatterns.cs
- DescendantBaseQuery.cs
- DataBoundControlHelper.cs
- XPathNode.cs
- ServiceMoniker.cs
- ThreadExceptionEvent.cs
- WinInet.cs
- WebPartExportVerb.cs
- Part.cs
- AuthenticationConfig.cs
- LessThan.cs
- CornerRadiusConverter.cs
- AssertFilter.cs
- FrameDimension.cs
- ProcessHostConfigUtils.cs
- ObjectCache.cs
- SettingsAttributeDictionary.cs
- safePerfProviderHandle.cs
- Light.cs
- ProfileSection.cs
- PassportPrincipal.cs
- Size3D.cs
- DeclarationUpdate.cs
- ExtendedPropertyDescriptor.cs
- cryptoapiTransform.cs
- BmpBitmapEncoder.cs
- PropertyChangedEventArgs.cs
- InputBinder.cs
- SQLBytesStorage.cs
- SamlAuthenticationClaimResource.cs
- ClientScriptManager.cs
- SendMailErrorEventArgs.cs
- SslSecurityTokenParameters.cs
- ValidateNames.cs
- FrameworkElementFactory.cs
- SqlDependency.cs
- DoubleUtil.cs
- ConfigXmlSignificantWhitespace.cs
- SourceCollection.cs
- errorpatternmatcher.cs
- BCLDebug.cs
- SiteMembershipCondition.cs
- SvcMapFile.cs
- Expander.cs
- MouseGestureValueSerializer.cs
- ScrollContentPresenter.cs
- SignatureGenerator.cs
- UrlMappingCollection.cs
- HierarchicalDataBoundControl.cs
- EncoderParameters.cs
- RelatedCurrencyManager.cs
- WindowsTooltip.cs
- PeerInvitationResponse.cs
- ParseNumbers.cs
- ObjectDataSourceEventArgs.cs
- METAHEADER.cs
- TextClipboardData.cs
- ScriptControlManager.cs
- ResourcePart.cs
- DesignerAdapterAttribute.cs
- EntityViewContainer.cs
- BindingGraph.cs
- OutOfMemoryException.cs
- MasterPageParser.cs
- HttpGetProtocolImporter.cs
- ProfileService.cs
- CriticalExceptions.cs
- PassportPrincipal.cs
- Font.cs
- WebBrowserEvent.cs
- DocumentGridPage.cs
- Context.cs
- PerformanceCounterPermissionEntryCollection.cs
- CommandArguments.cs
- PeerCollaboration.cs
- Parser.cs
- PerformanceCounters.cs
- SqlDataSourceView.cs
- RegexMatchCollection.cs
- OdbcConnectionStringbuilder.cs
- PrimitiveType.cs
- WebPartDescriptionCollection.cs
- ElementAtQueryOperator.cs
- ServiceOperation.cs
- DataGridTableStyleMappingNameEditor.cs
- ConnectionPointCookie.cs
- ZipIOExtraField.cs