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
- Module.cs
- DbUpdateCommandTree.cs
- FlowNode.cs
- SafeLocalMemHandle.cs
- HandoffBehavior.cs
- CatalogZone.cs
- HwndSubclass.cs
- EnumerableValidator.cs
- RelationshipType.cs
- ElementHostPropertyMap.cs
- ScriptManagerProxy.cs
- DocumentPaginator.cs
- ImmutableObjectAttribute.cs
- updateconfighost.cs
- TargetControlTypeCache.cs
- CodeMemberField.cs
- MouseDevice.cs
- ProcessManager.cs
- ExpressionBuilder.cs
- ApplicationFileParser.cs
- ProviderConnectionPoint.cs
- RTLAwareMessageBox.cs
- TemplatedMailWebEventProvider.cs
- ArgumentOutOfRangeException.cs
- DesignerActionUIService.cs
- CompositionTarget.cs
- WarningException.cs
- HotSpot.cs
- serverconfig.cs
- SessionStateItemCollection.cs
- DiscriminatorMap.cs
- CommentEmitter.cs
- NodeLabelEditEvent.cs
- OracleConnectionStringBuilder.cs
- XmlSchemaAnnotated.cs
- XmlCustomFormatter.cs
- DmlSqlGenerator.cs
- XmlText.cs
- LoadWorkflowByKeyAsyncResult.cs
- SqlCrossApplyToCrossJoin.cs
- RtfControlWordInfo.cs
- COMException.cs
- DoubleLink.cs
- _ListenerResponseStream.cs
- CompiledRegexRunner.cs
- DynamicRendererThreadManager.cs
- DBConnectionString.cs
- WriteFileContext.cs
- PrintPreviewGraphics.cs
- RelationshipEndMember.cs
- NamedPipeAppDomainProtocolHandler.cs
- Pen.cs
- EntryPointNotFoundException.cs
- MsmqIntegrationInputChannel.cs
- AuthenticationService.cs
- TypedTableBase.cs
- TransactionOptions.cs
- Types.cs
- WebPartCatalogAddVerb.cs
- LockRecursionException.cs
- StylusLogic.cs
- QueryCacheKey.cs
- EpmHelper.cs
- SqlLiftWhereClauses.cs
- Size3DValueSerializer.cs
- PageCatalogPartDesigner.cs
- InstanceKey.cs
- MembershipPasswordException.cs
- AutoResizedEvent.cs
- Point4D.cs
- BitmapCodecInfo.cs
- CompilerParameters.cs
- SqlClientWrapperSmiStream.cs
- SamlAttribute.cs
- XmlSchemaSimpleTypeUnion.cs
- IsolatedStorageException.cs
- UserInitiatedNavigationPermission.cs
- AttachedPropertyInfo.cs
- BinaryConverter.cs
- StrongNameIdentityPermission.cs
- ObjectIDGenerator.cs
- nulltextcontainer.cs
- RequestCache.cs
- SqlBulkCopyColumnMapping.cs
- SoapObjectWriter.cs
- XmlSchemaObject.cs
- FormatSettings.cs
- OleDbReferenceCollection.cs
- AQNBuilder.cs
- ManipulationInertiaStartingEventArgs.cs
- XPathChildIterator.cs
- AutoSizeComboBox.cs
- SchemeSettingElementCollection.cs
- _DigestClient.cs
- UserMapPath.cs
- ObjectKeyFrameCollection.cs
- MediaPlayerState.cs
- CallbackHandler.cs
- HebrewCalendar.cs
- UnionCqlBlock.cs