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
- DataTable.cs
- BodyGlyph.cs
- SqlDuplicator.cs
- RepeaterDataBoundAdapter.cs
- Help.cs
- ListViewContainer.cs
- MessageQueueAccessControlEntry.cs
- HashAlgorithm.cs
- Constraint.cs
- ValidationEventArgs.cs
- BufferedStream2.cs
- UserPreferenceChangingEventArgs.cs
- serverconfig.cs
- LocationReferenceValue.cs
- ConfigXmlSignificantWhitespace.cs
- PagesChangedEventArgs.cs
- SessionPageStateSection.cs
- PrintDocument.cs
- ContainerParagraph.cs
- GeometryGroup.cs
- COM2ComponentEditor.cs
- TcpConnectionPoolSettingsElement.cs
- AutomationElementCollection.cs
- WebBrowser.cs
- HttpServerChannel.cs
- UIElement3DAutomationPeer.cs
- ToolStripItemCollection.cs
- FtpWebResponse.cs
- SizeChangedEventArgs.cs
- GenericEnumerator.cs
- FormsAuthenticationUserCollection.cs
- NavigateEvent.cs
- Selection.cs
- DesignerObjectListAdapter.cs
- SqlFunctionAttribute.cs
- WindowsSecurityToken.cs
- ConnectionConsumerAttribute.cs
- SweepDirectionValidation.cs
- WebMethodAttribute.cs
- TemplateApplicationHelper.cs
- CallbackValidator.cs
- AllMembershipCondition.cs
- Group.cs
- OrderedHashRepartitionStream.cs
- WmiInstallComponent.cs
- Compiler.cs
- SelfIssuedTokenFactoryCredential.cs
- SpotLight.cs
- PropertyIDSet.cs
- HttpValueCollection.cs
- ValueExpressions.cs
- ForwardPositionQuery.cs
- ClientConvert.cs
- PkcsUtils.cs
- ContractMethodParameterInfo.cs
- SynchronizationContext.cs
- RepeatButton.cs
- ToolStripSettings.cs
- APCustomTypeDescriptor.cs
- TemplatedWizardStep.cs
- StyleSheet.cs
- RelationshipConstraintValidator.cs
- StreamWriter.cs
- PrimaryKeyTypeConverter.cs
- HorizontalAlignConverter.cs
- PolyQuadraticBezierSegment.cs
- BroadcastEventHelper.cs
- CqlBlock.cs
- Match.cs
- Attribute.cs
- DataGridrowEditEndingEventArgs.cs
- IntSecurity.cs
- CFStream.cs
- InProcStateClientManager.cs
- CallbackException.cs
- TimerElapsedEvenArgs.cs
- DictionaryManager.cs
- HMACSHA512.cs
- TransactionManager.cs
- SelectionList.cs
- ReadWriteObjectLock.cs
- TemplateNodeContextMenu.cs
- SafeThemeHandle.cs
- TextRenderer.cs
- NavigationProgressEventArgs.cs
- PanelStyle.cs
- XmlIlTypeHelper.cs
- SqlRewriteScalarSubqueries.cs
- CharKeyFrameCollection.cs
- DefaultPerformanceCounters.cs
- KnownTypesHelper.cs
- DisplayMemberTemplateSelector.cs
- panel.cs
- WinEventHandler.cs
- ConditionalAttribute.cs
- WebPartConnectionsConfigureVerb.cs
- EnumMember.cs
- DbModificationClause.cs
- CorrelationRequestContext.cs
- InkCanvas.cs