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
- WindowsPrincipal.cs
- RuntimeVariablesExpression.cs
- SqlCacheDependencyDatabase.cs
- ObjectParameter.cs
- ReversePositionQuery.cs
- JumpList.cs
- ComEventsInfo.cs
- RuleRefElement.cs
- InheritanceContextChangedEventManager.cs
- Solver.cs
- SecurityContext.cs
- PolyQuadraticBezierSegment.cs
- XmlSerializerNamespaces.cs
- GridToolTip.cs
- SessionEndingCancelEventArgs.cs
- DoubleAnimation.cs
- ForceCopyBuildProvider.cs
- HuffModule.cs
- SoapTypeAttribute.cs
- FillRuleValidation.cs
- ContainerSelectorBehavior.cs
- SerializationAttributes.cs
- AddInDeploymentState.cs
- ContextMenuAutomationPeer.cs
- RadioButtonStandardAdapter.cs
- CallbackTimeoutsElement.cs
- GridLengthConverter.cs
- LabelEditEvent.cs
- InheritanceAttribute.cs
- RestClientProxyHandler.cs
- ZipIORawDataFileBlock.cs
- DefaultTextStoreTextComposition.cs
- DockPatternIdentifiers.cs
- WsdlBuildProvider.cs
- ContainerParaClient.cs
- PropertyChangedEventManager.cs
- InfiniteTimeSpanConverter.cs
- CompositeActivityDesigner.cs
- ColumnHeaderConverter.cs
- ReferencedType.cs
- ResourceProviderFactory.cs
- SR.Designer.cs
- ListControl.cs
- SelfIssuedSamlTokenFactory.cs
- AsymmetricSignatureFormatter.cs
- XPathMessageFilterElementCollection.cs
- CompiledAction.cs
- UseLicense.cs
- CornerRadius.cs
- SqlDataSource.cs
- TableSectionStyle.cs
- TdsParameterSetter.cs
- WebHeaderCollection.cs
- ReferenceService.cs
- Array.cs
- VirtualDirectoryMapping.cs
- VirtualDirectoryMapping.cs
- GB18030Encoding.cs
- RegistrySecurity.cs
- XmlSchemaSearchPattern.cs
- RequestDescription.cs
- ServiceNameElement.cs
- ColorInterpolationModeValidation.cs
- AssociationSetEnd.cs
- MultitargetUtil.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- StrokeIntersection.cs
- SafeIUnknown.cs
- SelectionItemPattern.cs
- PathGeometry.cs
- SchemaManager.cs
- ObjectManager.cs
- WinEventWrap.cs
- Vector3DAnimationUsingKeyFrames.cs
- CodeExpressionStatement.cs
- WebMessageFormatHelper.cs
- AlphaSortedEnumConverter.cs
- IChannel.cs
- XslVisitor.cs
- OleDbWrapper.cs
- DataServiceQueryException.cs
- TransactionFlowOption.cs
- ProvidePropertyAttribute.cs
- DrawToolTipEventArgs.cs
- GregorianCalendar.cs
- CannotUnloadAppDomainException.cs
- InkCanvasFeedbackAdorner.cs
- ActivityDesignerResources.cs
- JsonEnumDataContract.cs
- DeclarativeCatalogPart.cs
- HtmlInputCheckBox.cs
- IndentedWriter.cs
- SafeHandles.cs
- XmlNodeList.cs
- DecoderFallbackWithFailureFlag.cs
- XpsPackagingException.cs
- TCPClient.cs
- DispatcherExceptionFilterEventArgs.cs
- AxHost.cs
- ScrollEvent.cs