Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewCellStyleConverter.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ChildTable.cs
- UnsafeNativeMethods.cs
- CreateUserWizardStep.cs
- DirectoryInfo.cs
- XmlSchemaAttribute.cs
- TableStyle.cs
- Line.cs
- SafeCertificateStore.cs
- UiaCoreApi.cs
- Attributes.cs
- FileDialogCustomPlace.cs
- ColumnMapProcessor.cs
- MoveSizeWinEventHandler.cs
- BitmapEffect.cs
- LZCodec.cs
- KeyedCollection.cs
- DataSourceView.cs
- GeneratedContractType.cs
- TextParagraphCache.cs
- SecurityVersion.cs
- DocumentPageHost.cs
- ResourceDisplayNameAttribute.cs
- XmlProcessingInstruction.cs
- RealizationContext.cs
- DataGridColumnCollectionEditor.cs
- UrlRoutingModule.cs
- RawStylusInput.cs
- PackageFilter.cs
- SafeNativeMethods.cs
- TcpPortSharing.cs
- Vector3DAnimationUsingKeyFrames.cs
- HybridObjectCache.cs
- DrawListViewItemEventArgs.cs
- NativeMethods.cs
- DrawingServices.cs
- PtsContext.cs
- ErrorHandler.cs
- SafeFileHandle.cs
- SvcMapFileSerializer.cs
- FrameworkElementFactory.cs
- StateDesigner.TransitionInfo.cs
- DeclarativeExpressionConditionDeclaration.cs
- TTSEvent.cs
- ChangesetResponse.cs
- BasicCellRelation.cs
- WebSysDefaultValueAttribute.cs
- BrowserDefinition.cs
- IndicShape.cs
- FullTextState.cs
- RuntimeEnvironment.cs
- DesignTimeTemplateParser.cs
- EDesignUtil.cs
- SoapUnknownHeader.cs
- OleCmdHelper.cs
- InvalidPipelineStoreException.cs
- ShapeTypeface.cs
- TrustSection.cs
- Rect3DValueSerializer.cs
- CommentEmitter.cs
- OnOperation.cs
- Encoder.cs
- DataControlFieldHeaderCell.cs
- XmlnsDefinitionAttribute.cs
- StringValueConverter.cs
- ResetableIterator.cs
- DummyDataSource.cs
- httpserverutility.cs
- HtmlToClrEventProxy.cs
- DropSource.cs
- WebPartManagerInternals.cs
- ListControl.cs
- DataSet.cs
- XmlSchemaSimpleTypeList.cs
- NavigatorInput.cs
- DropSource.cs
- AttributeUsageAttribute.cs
- Int64Animation.cs
- RecognizedAudio.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- ProcessManager.cs
- GlobalAllocSafeHandle.cs
- FormViewPageEventArgs.cs
- OracleParameter.cs
- BinaryFormatter.cs
- ConstraintCollection.cs
- Stack.cs
- TextTreeNode.cs
- WebPartAuthorizationEventArgs.cs
- HttpFormatExtensions.cs
- LayoutSettings.cs
- ProcessModelSection.cs
- JoinCqlBlock.cs
- ServiceOperationUIEditor.cs
- DelegatedStream.cs
- ResXDataNode.cs
- OdbcTransaction.cs
- HtmlImage.cs
- ClientTargetSection.cs
- ObjectCloneHelper.cs
- StrokeCollection.cs