Code:
/ FX-1434 / FX-1434 / 1.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
- TransformerConfigurationWizardBase.cs
- Vector3DValueSerializer.cs
- DES.cs
- ConnectionManagementSection.cs
- StreamInfo.cs
- TextViewBase.cs
- ProjectionPath.cs
- DataStreams.cs
- ToolStripItemTextRenderEventArgs.cs
- AppendHelper.cs
- StyleXamlParser.cs
- CriticalHandle.cs
- DataServiceConfiguration.cs
- TimeSpanConverter.cs
- ActivityBindForm.cs
- DragEvent.cs
- MethodBuilderInstantiation.cs
- NumericExpr.cs
- SqlDataSourceEnumerator.cs
- FileEnumerator.cs
- EventLogPermissionEntryCollection.cs
- RecognizerStateChangedEventArgs.cs
- TeredoHelper.cs
- ImmutablePropertyDescriptorGridEntry.cs
- TableLayoutSettings.cs
- ListSourceHelper.cs
- OverrideMode.cs
- hresults.cs
- HScrollBar.cs
- FixedNode.cs
- TextHidden.cs
- EntityParameterCollection.cs
- ClientConfigurationHost.cs
- SqlCachedBuffer.cs
- Win32Native.cs
- NodeFunctions.cs
- ReferentialConstraintRoleElement.cs
- Expression.cs
- PenThreadPool.cs
- HtmlInputHidden.cs
- TableStyle.cs
- DetailsViewPageEventArgs.cs
- ConnectionStringsSection.cs
- ZoneIdentityPermission.cs
- SpecialNameAttribute.cs
- SystemNetHelpers.cs
- EventDescriptorCollection.cs
- MappedMetaModel.cs
- CreateUserWizardAutoFormat.cs
- OrderedEnumerableRowCollection.cs
- RuntimeConfig.cs
- TraceContext.cs
- CompiledQueryCacheEntry.cs
- SessionStateContainer.cs
- PageBreakRecord.cs
- SeekStoryboard.cs
- TcpSocketManager.cs
- DateTimeFormatInfo.cs
- IteratorDescriptor.cs
- TextServicesManager.cs
- BlurBitmapEffect.cs
- LabelExpression.cs
- GeometryHitTestResult.cs
- DataGridViewCellValidatingEventArgs.cs
- XmlNotation.cs
- ComponentSerializationService.cs
- AppDomainFactory.cs
- XpsS0ValidatingLoader.cs
- FontUnitConverter.cs
- PropertyValueUIItem.cs
- SchemaComplexType.cs
- RegexRunnerFactory.cs
- Stackframe.cs
- safelinkcollection.cs
- DataGridViewColumnDesigner.cs
- ResourceProperty.cs
- While.cs
- PaginationProgressEventArgs.cs
- InterleavedZipPartStream.cs
- DbDataRecord.cs
- LabelDesigner.cs
- PostBackOptions.cs
- DynamicILGenerator.cs
- TimeoutValidationAttribute.cs
- ArrayWithOffset.cs
- EntityProviderFactory.cs
- LocationChangedEventArgs.cs
- DataSourceControlBuilder.cs
- MeasureData.cs
- SelectiveScrollingGrid.cs
- ForwardPositionQuery.cs
- TemplatedWizardStep.cs
- TypeDescriptionProvider.cs
- SHA384.cs
- HttpCachePolicyElement.cs
- DeferredBinaryDeserializerExtension.cs
- LightweightCodeGenerator.cs
- HttpContext.cs
- RewritingSimplifier.cs
- HealthMonitoringSection.cs