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
- QueryExtender.cs
- CustomCredentialPolicy.cs
- XPathMultyIterator.cs
- DictionaryContent.cs
- SQLSingle.cs
- DisplayMemberTemplateSelector.cs
- CodeDefaultValueExpression.cs
- CultureInfoConverter.cs
- ShapingWorkspace.cs
- ImageCodecInfoPrivate.cs
- DispatcherProcessingDisabled.cs
- WindowHelperService.cs
- BooleanProjectedSlot.cs
- Exception.cs
- _NTAuthentication.cs
- Font.cs
- Italic.cs
- InfiniteIntConverter.cs
- COM2FontConverter.cs
- Utils.cs
- ChtmlPhoneCallAdapter.cs
- SafeMILHandle.cs
- HWStack.cs
- XmlCDATASection.cs
- TypeDescriptor.cs
- Vector3DAnimation.cs
- FormsAuthenticationUserCollection.cs
- ErrorFormatter.cs
- ProfileBuildProvider.cs
- EventWaitHandleSecurity.cs
- DataSourceXmlClassAttribute.cs
- ListSourceHelper.cs
- PowerStatus.cs
- DirectionalLight.cs
- _ConnectOverlappedAsyncResult.cs
- StreamWithDictionary.cs
- XmlSchemaValidator.cs
- AddInProcess.cs
- SEHException.cs
- BinaryObjectInfo.cs
- RadioButtonDesigner.cs
- MergePropertyDescriptor.cs
- Accessors.cs
- TypeUtils.cs
- TreeNodeSelectionProcessor.cs
- DataGridViewRow.cs
- MsmqIntegrationBindingElement.cs
- SystemUnicastIPAddressInformation.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- ListViewHitTestInfo.cs
- FocusChangedEventArgs.cs
- OleDbReferenceCollection.cs
- SerializationAttributes.cs
- LinearGradientBrush.cs
- SaveFileDialog.cs
- DecimalConstantAttribute.cs
- UriExt.cs
- AdapterUtil.cs
- StringUtil.cs
- KnownBoxes.cs
- SymLanguageType.cs
- AxDesigner.cs
- CheckBox.cs
- ObjectDataSourceView.cs
- DataShape.cs
- SafeNativeMethods.cs
- LOSFormatter.cs
- SystemResourceHost.cs
- SessionStateModule.cs
- AutomationProperties.cs
- SerializationObjectManager.cs
- BindingBase.cs
- ReferenceEqualityComparer.cs
- GlyphTypeface.cs
- UnlockInstanceAsyncResult.cs
- CodeIdentifier.cs
- SocketException.cs
- PackWebRequestFactory.cs
- UIElementParagraph.cs
- LinearQuaternionKeyFrame.cs
- MimeTypeAttribute.cs
- RuntimeIdentifierPropertyAttribute.cs
- ControlBuilderAttribute.cs
- OperationContext.cs
- DataSet.cs
- ImpersonateTokenRef.cs
- Compilation.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- TCEAdapterGenerator.cs
- DataTableClearEvent.cs
- DataSourceControlBuilder.cs
- Pair.cs
- LassoHelper.cs
- keycontainerpermission.cs
- GetCertificateRequest.cs
- RefType.cs
- GridViewCellAutomationPeer.cs
- ActivityBindForm.cs
- DayRenderEvent.cs
- StopRoutingHandler.cs