Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewCellConverter.cs / 1 / DataGridViewCellConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms { using System; using System.Windows.Forms; using System.Globalization; using System.ComponentModel; using System.Reflection; using System.Runtime.Serialization.Formatters; using System.ComponentModel.Design.Serialization; // used by the designer to serialize the DataGridViewCell class internal class DataGridViewCellConverter : ExpandableObjectConverter { public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(InstanceDescriptor)) { return true; } return base.CanConvertTo(context, destinationType); } public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == null) { throw new ArgumentNullException("destinationType"); } DataGridViewCell cell = value as DataGridViewCell; if (destinationType == typeof(InstanceDescriptor) && cell != null) { ConstructorInfo ctor = cell.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
- ReverseComparer.cs
- Documentation.cs
- CellTreeNode.cs
- AddingNewEventArgs.cs
- EntityContainerAssociationSet.cs
- SessionEndingCancelEventArgs.cs
- LicenseException.cs
- ToolboxComponentsCreatedEventArgs.cs
- SHA1.cs
- AddInPipelineAttributes.cs
- IPeerNeighbor.cs
- OracleFactory.cs
- BuilderPropertyEntry.cs
- MenuItem.cs
- ProfileSettings.cs
- Lasso.cs
- UInt32.cs
- DataSvcMapFileSerializer.cs
- CrossSiteScriptingValidation.cs
- OrderedHashRepartitionEnumerator.cs
- DesignerCommandAdapter.cs
- TimestampInformation.cs
- DataGridViewSelectedCellCollection.cs
- DocumentGridContextMenu.cs
- x509store.cs
- BinaryMethodMessage.cs
- BufferAllocator.cs
- FreezableDefaultValueFactory.cs
- ContextQuery.cs
- InternalRelationshipCollection.cs
- OpCodes.cs
- PropertyTab.cs
- ValueTypeIndexerReference.cs
- StartUpEventArgs.cs
- Rect.cs
- HttpListenerException.cs
- HttpListenerResponse.cs
- MsmqHostedTransportManager.cs
- ByteFacetDescriptionElement.cs
- IImplicitResourceProvider.cs
- TextHidden.cs
- ListParagraph.cs
- HttpModuleCollection.cs
- ListView.cs
- CookieParameter.cs
- HtmlShimManager.cs
- SecurityState.cs
- NullableIntAverageAggregationOperator.cs
- XmlElementList.cs
- WebSysDescriptionAttribute.cs
- BitmapEffectDrawing.cs
- AbsoluteQuery.cs
- ParallelRangeManager.cs
- PathData.cs
- XmlStringTable.cs
- counter.cs
- SeekStoryboard.cs
- FunctionCommandText.cs
- XmlMapping.cs
- SurrogateEncoder.cs
- TreeNodeStyleCollection.cs
- DecoderExceptionFallback.cs
- ExtractedStateEntry.cs
- Wildcard.cs
- XmlNamespaceMapping.cs
- DataTableMapping.cs
- RotationValidation.cs
- TreeViewImageIndexConverter.cs
- PassportPrincipal.cs
- FunctionCommandText.cs
- DllNotFoundException.cs
- QueueException.cs
- IfAction.cs
- WrappingXamlSchemaContext.cs
- MenuStrip.cs
- ToolStripPanelRow.cs
- FileDataSourceCache.cs
- TextRangeEditLists.cs
- HtmlEncodedRawTextWriter.cs
- OletxResourceManager.cs
- TableStyle.cs
- SqlCommandSet.cs
- QueryCursorEventArgs.cs
- FilterQuery.cs
- SessionStateSection.cs
- ExpandoClass.cs
- Marshal.cs
- TypeSemantics.cs
- Transaction.cs
- PropertyMetadata.cs
- StorageScalarPropertyMapping.cs
- ServiceModelEnumValidatorAttribute.cs
- RepeatInfo.cs
- TextElementEnumerator.cs
- EntityProviderFactory.cs
- ApplicationContext.cs
- CriticalFinalizerObject.cs
- ToolboxComponentsCreatingEventArgs.cs
- ObservableDictionary.cs
- ThreadNeutralSemaphore.cs