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
- Int32Rect.cs
- BitConverter.cs
- WebPartPersonalization.cs
- NameTable.cs
- FixedNode.cs
- DbExpressionRules.cs
- XmlILStorageConverter.cs
- BoundColumn.cs
- TextTreeRootTextBlock.cs
- BookmarkEventArgs.cs
- DataGridViewCellPaintingEventArgs.cs
- MergePropertyDescriptor.cs
- ListItemCollection.cs
- BuilderPropertyEntry.cs
- XPathChildIterator.cs
- XhtmlBasicListAdapter.cs
- ListArgumentProvider.cs
- EntityDataSourceContextDisposingEventArgs.cs
- DefaultMemberAttribute.cs
- PropertyItem.cs
- MailMessage.cs
- PlatformCulture.cs
- Menu.cs
- BindingExpression.cs
- HttpRequestCacheValidator.cs
- DataSourceView.cs
- AsyncSerializedWorker.cs
- LinqTreeNodeEvaluator.cs
- ToolboxItemLoader.cs
- PackageRelationshipSelector.cs
- StandardBindingImporter.cs
- IntegerFacetDescriptionElement.cs
- XmlDocumentFragment.cs
- TextRangeEditLists.cs
- AsynchronousChannelMergeEnumerator.cs
- AssemblyCache.cs
- ListViewTableCell.cs
- HttpClientProtocol.cs
- CryptoApi.cs
- SystemBrushes.cs
- SponsorHelper.cs
- TableLayoutPanelCellPosition.cs
- DocumentViewerAutomationPeer.cs
- ResXDataNode.cs
- PartialCachingControl.cs
- PropertyAccessVisitor.cs
- InputEventArgs.cs
- XamlTypeMapper.cs
- SubstitutionResponseElement.cs
- AssemblyNameProxy.cs
- SqlFacetAttribute.cs
- StreamGeometryContext.cs
- SineEase.cs
- Frame.cs
- ToolStripLabel.cs
- AliasGenerator.cs
- LexicalChunk.cs
- DesignBindingConverter.cs
- StringPropertyBuilder.cs
- Gdiplus.cs
- SmtpReplyReader.cs
- KeyTimeConverter.cs
- WizardPanel.cs
- EntityDataSourceSelectingEventArgs.cs
- MetabaseServerConfig.cs
- UIPermission.cs
- WindowsBrush.cs
- ValueConversionAttribute.cs
- basevalidator.cs
- ScrollProviderWrapper.cs
- CodeChecksumPragma.cs
- RoleService.cs
- QueryResult.cs
- ErrorRuntimeConfig.cs
- HtmlControlPersistable.cs
- FilterQuery.cs
- RightsManagementEncryptionTransform.cs
- DataGridTextBoxColumn.cs
- TokenizerHelper.cs
- UIEndRequest.cs
- PrtTicket_Base.cs
- CheckBoxPopupAdapter.cs
- CellParaClient.cs
- CheckedListBox.cs
- DataListItem.cs
- TextTabProperties.cs
- InputBinder.cs
- EncoderBestFitFallback.cs
- Signature.cs
- LinqDataSource.cs
- DescendantBaseQuery.cs
- ChangesetResponse.cs
- NamedElement.cs
- XmlSchemaGroupRef.cs
- ImageSource.cs
- HealthMonitoringSection.cs
- baseshape.cs
- GiveFeedbackEvent.cs
- RowType.cs
- ProfileServiceManager.cs