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
- TimelineGroup.cs
- VectorAnimationUsingKeyFrames.cs
- TextElement.cs
- XPathQilFactory.cs
- WmlCalendarAdapter.cs
- ColorConverter.cs
- DrawingContextDrawingContextWalker.cs
- CompositeKey.cs
- RepeatButton.cs
- PeerEndPoint.cs
- FrameworkRichTextComposition.cs
- DataGridViewColumnEventArgs.cs
- TokenBasedSetEnumerator.cs
- QueryAsyncResult.cs
- IgnoreSectionHandler.cs
- ApplicationTrust.cs
- DoubleLinkListEnumerator.cs
- TouchesCapturedWithinProperty.cs
- ConditionalExpression.cs
- EditorZoneBase.cs
- ContentPosition.cs
- ZipIOCentralDirectoryFileHeader.cs
- StaticTextPointer.cs
- LogConverter.cs
- MonthChangedEventArgs.cs
- MD5.cs
- PhonemeEventArgs.cs
- TokenFactoryBase.cs
- StrongNameIdentityPermission.cs
- ApplicationException.cs
- EntityConnectionStringBuilder.cs
- SystemSounds.cs
- SettingsProperty.cs
- XmlLanguage.cs
- DispatchWrapper.cs
- UIPermission.cs
- MemberRestriction.cs
- UntrustedRecipientException.cs
- StagingAreaInputItem.cs
- PasswordDeriveBytes.cs
- PropertyManager.cs
- ListItemParagraph.cs
- XmlWellformedWriter.cs
- DoubleIndependentAnimationStorage.cs
- SimpleType.cs
- Bitmap.cs
- HttpPostedFile.cs
- MulticastOption.cs
- Journal.cs
- DataGridCommandEventArgs.cs
- SymbolDocumentGenerator.cs
- ScrollViewer.cs
- MethodToken.cs
- BinaryParser.cs
- XmlSchemaDocumentation.cs
- BinaryVersion.cs
- TabletCollection.cs
- SqlConnectionFactory.cs
- _LazyAsyncResult.cs
- Lasso.cs
- DataGridTableStyleMappingNameEditor.cs
- ParserStreamGeometryContext.cs
- LifetimeServices.cs
- ConfigXmlWhitespace.cs
- XPathQilFactory.cs
- SQLStringStorage.cs
- RegionData.cs
- SystemIPInterfaceProperties.cs
- EmptyCollection.cs
- SafeMILHandleMemoryPressure.cs
- DataGridViewCheckBoxCell.cs
- SessionState.cs
- SqlFlattener.cs
- RemotingSurrogateSelector.cs
- DiagnosticTrace.cs
- XPathScanner.cs
- SqlConnection.cs
- ServiceEndpointCollection.cs
- ToolboxBitmapAttribute.cs
- Section.cs
- ParserContext.cs
- SqlSupersetValidator.cs
- coordinatorfactory.cs
- ReachPrintTicketSerializerAsync.cs
- SchemaTableOptionalColumn.cs
- OperationAbortedException.cs
- PropertyChangedEventArgs.cs
- IndexedGlyphRun.cs
- StyleCollection.cs
- Helpers.cs
- ComponentCodeDomSerializer.cs
- ItemContainerPattern.cs
- wgx_render.cs
- PresentationAppDomainManager.cs
- RewritingSimplifier.cs
- HandleCollector.cs
- WCFServiceClientProxyGenerator.cs
- MimeTypePropertyAttribute.cs
- VerticalConnector.xaml.cs
- DataGridToolTip.cs