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
- StopRoutingHandler.cs
- Duration.cs
- UnsignedPublishLicense.cs
- HostExecutionContextManager.cs
- XmlILOptimizerVisitor.cs
- CacheAxisQuery.cs
- XmlWrappingReader.cs
- CommonXSendMessage.cs
- FileUtil.cs
- FormViewUpdatedEventArgs.cs
- DependencyPropertyChangedEventArgs.cs
- FilterException.cs
- Attributes.cs
- CodeDirectoryCompiler.cs
- ObjectAssociationEndMapping.cs
- TextCompositionEventArgs.cs
- TextRenderingModeValidation.cs
- DataGridViewRowsAddedEventArgs.cs
- HttpCookie.cs
- PenContexts.cs
- HotSpot.cs
- MultipartContentParser.cs
- WebServiceParameterData.cs
- Pair.cs
- VirtualPath.cs
- BinHexEncoder.cs
- odbcmetadatacolumnnames.cs
- BigInt.cs
- TypeToken.cs
- DataContractSerializerServiceBehavior.cs
- ExpandCollapseProviderWrapper.cs
- Configuration.cs
- FloaterBaseParaClient.cs
- NativeActivityMetadata.cs
- XmlDeclaration.cs
- ReadOnlyNameValueCollection.cs
- CompilerError.cs
- InstanceView.cs
- CustomBindingElement.cs
- JsonXmlDataContract.cs
- IteratorFilter.cs
- Int32AnimationUsingKeyFrames.cs
- GB18030Encoding.cs
- GenericUriParser.cs
- RadioButtonFlatAdapter.cs
- ZeroOpNode.cs
- NetworkAddressChange.cs
- TraceHelpers.cs
- CharacterHit.cs
- XmlEntityReference.cs
- TemplateModeChangedEventArgs.cs
- SystemIcmpV4Statistics.cs
- SqlClientWrapperSmiStream.cs
- DataGridComboBoxColumn.cs
- FixedSOMImage.cs
- AvTrace.cs
- ClientCredentialsSecurityTokenManager.cs
- XmlSchemaGroupRef.cs
- Number.cs
- HttpWebResponse.cs
- SerializableAuthorizationContext.cs
- PartitionedStream.cs
- LoginUtil.cs
- SelectedGridItemChangedEvent.cs
- GeometryCollection.cs
- UnhandledExceptionEventArgs.cs
- InstanceCreationEditor.cs
- SqlTopReducer.cs
- WhereQueryOperator.cs
- MergePropertyDescriptor.cs
- WinEventQueueItem.cs
- Wildcard.cs
- ConfigurationValidatorBase.cs
- UnsafeNativeMethods.cs
- documentsequencetextview.cs
- Point4D.cs
- InvalidDataContractException.cs
- ClientSettingsStore.cs
- MachineKeyConverter.cs
- RecognitionEventArgs.cs
- TemplateLookupAction.cs
- IsolatedStoragePermission.cs
- DataSourceBooleanViewSchemaConverter.cs
- WebDescriptionAttribute.cs
- QilXmlReader.cs
- FixedDSBuilder.cs
- CheckBoxField.cs
- httpserverutility.cs
- _HeaderInfo.cs
- StrongNameMembershipCondition.cs
- RC2.cs
- BinaryReader.cs
- FlowLayoutPanel.cs
- CheckBoxBaseAdapter.cs
- WSHttpSecurityElement.cs
- ByteAnimationBase.cs
- DropAnimation.xaml.cs
- WebEventCodes.cs
- MethodBuilder.cs
- SingletonInstanceContextProvider.cs