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
- ObjectDataSource.cs
- ButtonChrome.cs
- TrackingProfileDeserializationException.cs
- SelectQueryOperator.cs
- XNodeSchemaApplier.cs
- Encoding.cs
- RawStylusInputCustomDataList.cs
- DelegateInArgument.cs
- CellTreeSimplifier.cs
- EncodingTable.cs
- SamlSerializer.cs
- ResourcesChangeInfo.cs
- SafeRegistryKey.cs
- FontWeightConverter.cs
- GridItemProviderWrapper.cs
- contentDescriptor.cs
- NullReferenceException.cs
- DbProviderFactories.cs
- OptimalTextSource.cs
- SqlStatistics.cs
- ConstructorBuilder.cs
- RuntimeHelpers.cs
- BmpBitmapEncoder.cs
- UseManagedPresentationBindingElementImporter.cs
- CodeDomSerializer.cs
- Form.cs
- InvalidDataException.cs
- XamlReader.cs
- RotateTransform3D.cs
- ControlCommandSet.cs
- ProfessionalColorTable.cs
- CanExecuteRoutedEventArgs.cs
- Binding.cs
- Mappings.cs
- IPPacketInformation.cs
- CannotUnloadAppDomainException.cs
- XmlAutoDetectWriter.cs
- MessageDecoder.cs
- DataProtection.cs
- ServiceParser.cs
- MergeLocalizationDirectives.cs
- MinMaxParagraphWidth.cs
- SelectionChangedEventArgs.cs
- Rect3D.cs
- TemplateComponentConnector.cs
- DataBindingExpressionBuilder.cs
- WindowsBrush.cs
- ZoneButton.cs
- ObjectParameter.cs
- TokenBasedSet.cs
- AuthenticatingEventArgs.cs
- PortCache.cs
- SerializationHelper.cs
- ElementMarkupObject.cs
- PermissionRequestEvidence.cs
- XComponentModel.cs
- BitmapScalingModeValidation.cs
- ErrorView.xaml.cs
- BindUriHelper.cs
- DashStyle.cs
- SqlClientWrapperSmiStreamChars.cs
- XmlUnspecifiedAttribute.cs
- NetTcpSecurity.cs
- StickyNote.cs
- SplitterPanel.cs
- EntityDataSourceView.cs
- GroupDescription.cs
- BigInt.cs
- RunWorkerCompletedEventArgs.cs
- OleDbCommandBuilder.cs
- SafeRegistryHandle.cs
- TagPrefixAttribute.cs
- XmlUtil.cs
- XmlILOptimizerVisitor.cs
- DataBoundControlHelper.cs
- CommandBindingCollection.cs
- SerializerDescriptor.cs
- RepeatInfo.cs
- ObjectDataSourceEventArgs.cs
- RecordsAffectedEventArgs.cs
- SamlAttribute.cs
- FixedSOMTextRun.cs
- RuntimeConfig.cs
- UrlMapping.cs
- TextServicesCompartmentEventSink.cs
- BinaryObjectWriter.cs
- ColorMap.cs
- Vector3D.cs
- QueryReaderSettings.cs
- BooleanConverter.cs
- input.cs
- CustomAssemblyResolver.cs
- EnumerableRowCollection.cs
- CompressedStack.cs
- DbMetaDataCollectionNames.cs
- EventHandlersDesigner.cs
- MetadataItemEmitter.cs
- Metafile.cs
- ResourceReferenceKeyNotFoundException.cs
- BindingList.cs