Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewCellStyleConverter.cs / 1 / DataGridViewCellStyleConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Windows.Forms { using System.Runtime.Serialization.Formatters; using System.Runtime.Remoting; using System.Runtime.InteropServices; using Microsoft.Win32; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Globalization; using System.Reflection; ////// /// public class DataGridViewCellStyleConverter : TypeConverter { ////// /// public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(InstanceDescriptor)) { return true; } return base.CanConvertTo(context, destinationType); } ///Gets a value indicating whether this converter can /// convert an object to the given destination type using the context. ////// /// Converts the given object to another type. The most common types to convert /// are to and from a string object. The default implementation will make a call /// to ToString on the object if the object is valid and if the destination /// type is string. If this cannot convert to the desitnation type, this will /// throw a NotSupportedException. /// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == null) { throw new ArgumentNullException("destinationType"); } if (destinationType == typeof(InstanceDescriptor) && value is DataGridViewCellStyle) { ConstructorInfo ctor = value.GetType().GetConstructor(new Type[0]); 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
- SplitContainer.cs
- NetworkInformationException.cs
- SamlSecurityTokenAuthenticator.cs
- DataTableReaderListener.cs
- EncryptedHeader.cs
- GeometryDrawing.cs
- StickyNoteContentControl.cs
- SerializableReadOnlyDictionary.cs
- RadioButton.cs
- ReflectionUtil.cs
- TextBoxBase.cs
- WorkflowExecutor.cs
- InputProviderSite.cs
- SID.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- PathFigure.cs
- WindowsSysHeader.cs
- CheckBoxList.cs
- ADRoleFactoryConfiguration.cs
- Preprocessor.cs
- FixedSOMLineCollection.cs
- RowToFieldTransformer.cs
- AsmxEndpointPickerExtension.cs
- HtmlEncodedRawTextWriter.cs
- XmlSortKeyAccumulator.cs
- VScrollBar.cs
- InertiaTranslationBehavior.cs
- PieceDirectory.cs
- AttachmentCollection.cs
- DataGridViewTextBoxEditingControl.cs
- SignedXml.cs
- CryptoKeySecurity.cs
- TabPage.cs
- TransformerInfoCollection.cs
- SiteMapProvider.cs
- DefaultPropertiesToSend.cs
- SchemaInfo.cs
- BamlLocalizableResource.cs
- dtdvalidator.cs
- StructuredTypeEmitter.cs
- SafeEventLogWriteHandle.cs
- BeginEvent.cs
- DbMetaDataCollectionNames.cs
- FontUnit.cs
- XhtmlBasicImageAdapter.cs
- LocalizationParserHooks.cs
- CommandCollectionEditor.cs
- GridItemCollection.cs
- XmlTextAttribute.cs
- InternalException.cs
- InputLanguage.cs
- WindowHideOrCloseTracker.cs
- EntityType.cs
- InvalidCommandTreeException.cs
- MarshalByRefObject.cs
- BaseCodeDomTreeGenerator.cs
- OleDbDataAdapter.cs
- WMICapabilities.cs
- WebPartZoneBase.cs
- DependencyObjectCodeDomSerializer.cs
- FormsAuthenticationUser.cs
- Convert.cs
- ModelUIElement3D.cs
- MsmqTransportSecurity.cs
- TraceHandlerErrorFormatter.cs
- ResourceProperty.cs
- StorageConditionPropertyMapping.cs
- ServiceEndpointCollection.cs
- ConfigurationFileMap.cs
- PersonalizationProviderCollection.cs
- JsonReaderWriterFactory.cs
- SafeNativeMethods.cs
- _SecureChannel.cs
- CodeGeneratorOptions.cs
- WorkflowFileItem.cs
- AmbiguousMatchException.cs
- AccessDataSourceView.cs
- AttributeProviderAttribute.cs
- PopOutPanel.cs
- _RequestCacheProtocol.cs
- CustomValidator.cs
- Blend.cs
- ListViewPagedDataSource.cs
- StorageFunctionMapping.cs
- WebPartUserCapability.cs
- ParsedAttributeCollection.cs
- FileDialogCustomPlaces.cs
- CryptoStream.cs
- InternalBase.cs
- SymbolType.cs
- CompressionTransform.cs
- DigestTraceRecordHelper.cs
- RsaKeyIdentifierClause.cs
- ToolStripPanel.cs
- GeneralTransform3DGroup.cs
- FilteredXmlReader.cs
- CompilerParameters.cs
- WindowsFormsHostAutomationPeer.cs
- Win32SafeHandles.cs
- SamlDelegatingWriter.cs