Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewCellConverter.cs / 1305376 / 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
- UIElementParaClient.cs
- RoutedCommand.cs
- ContentPlaceHolder.cs
- ToolStripHighContrastRenderer.cs
- CaseInsensitiveOrdinalStringComparer.cs
- RijndaelManaged.cs
- MouseButtonEventArgs.cs
- ResourceFallbackManager.cs
- SHA256.cs
- SpotLight.cs
- SemanticBasicElement.cs
- DataGridItemEventArgs.cs
- RenderData.cs
- ConditionalAttribute.cs
- ZoomingMessageFilter.cs
- BrushConverter.cs
- SecurityPermission.cs
- TemplateKey.cs
- DataSpaceManager.cs
- NominalTypeEliminator.cs
- SelectedDatesCollection.cs
- DbConnectionPoolGroupProviderInfo.cs
- CodeTypeOfExpression.cs
- ValidationPropertyAttribute.cs
- Msmq4PoisonHandler.cs
- RegexFCD.cs
- SemanticValue.cs
- AutomationProperties.cs
- ConstraintStruct.cs
- RootProfilePropertySettingsCollection.cs
- EntityUtil.cs
- XPathExpr.cs
- LogEntrySerialization.cs
- DataTableMappingCollection.cs
- WebPartTransformerCollection.cs
- TransactionChannel.cs
- DataRowExtensions.cs
- AspNetSynchronizationContext.cs
- RijndaelManagedTransform.cs
- DefaultValidator.cs
- BaseComponentEditor.cs
- BuildResult.cs
- InfoCardProofToken.cs
- cookiecollection.cs
- COM2PropertyDescriptor.cs
- FormViewDeletedEventArgs.cs
- ValidatingPropertiesEventArgs.cs
- RegexWorker.cs
- AnnotationAuthorChangedEventArgs.cs
- BaseDataList.cs
- Compiler.cs
- DoubleCollectionValueSerializer.cs
- SslStream.cs
- Message.cs
- OleDbCommand.cs
- EntitySet.cs
- DataTablePropertyDescriptor.cs
- ColumnHeaderConverter.cs
- AccessControlEntry.cs
- SqlDependency.cs
- LogLogRecordEnumerator.cs
- UriTemplateHelpers.cs
- ValidatedMobileControlConverter.cs
- DataGridTablesFactory.cs
- XmlStringTable.cs
- DataGridRowDetailsEventArgs.cs
- PeerCollaboration.cs
- ConnectionStringSettings.cs
- StringWriter.cs
- DynamicArgumentDialog.cs
- TextLineBreak.cs
- SelectingProviderEventArgs.cs
- TailCallAnalyzer.cs
- Guid.cs
- TargetInvocationException.cs
- Binding.cs
- PerfCounterSection.cs
- CreateDataSourceDialog.cs
- FormsAuthenticationConfiguration.cs
- XPathChildIterator.cs
- XmlSchemaSimpleContentExtension.cs
- TableLayoutSettingsTypeConverter.cs
- SafeBitVector32.cs
- UniqueIdentifierService.cs
- ListBindingHelper.cs
- AssemblyAttributes.cs
- OrderedDictionary.cs
- XPathConvert.cs
- FixedTextBuilder.cs
- Rfc2898DeriveBytes.cs
- CurrencyWrapper.cs
- ListMarkerSourceInfo.cs
- CustomError.cs
- JsonSerializer.cs
- C14NUtil.cs
- CodeArgumentReferenceExpression.cs
- ZoneButton.cs
- LocalsItemDescription.cs
- CompiledQueryCacheEntry.cs
- BitmapEffectOutputConnector.cs