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
- ActiveXContainer.cs
- RegexMatchCollection.cs
- TagPrefixAttribute.cs
- BuildResultCache.cs
- NavigatorOutput.cs
- LogEntrySerialization.cs
- RIPEMD160Managed.cs
- PerspectiveCamera.cs
- Formatter.cs
- BitSet.cs
- DynamicPropertyHolder.cs
- PropertyInfo.cs
- LocatorPartList.cs
- GrammarBuilder.cs
- DocumentViewerHelper.cs
- TableRow.cs
- StylusCollection.cs
- RepeaterItemCollection.cs
- FilterUserControlBase.cs
- SiteMap.cs
- ReferenceEqualityComparer.cs
- BufferedGraphics.cs
- ReferencedType.cs
- DeviceSpecificDesigner.cs
- ProcessModelSection.cs
- ConfigXmlComment.cs
- SchemaElementDecl.cs
- MouseOverProperty.cs
- CodePageUtils.cs
- OutputCacheProfile.cs
- XsltQilFactory.cs
- OdbcConnectionPoolProviderInfo.cs
- DataGridColumnStyleMappingNameEditor.cs
- DataStorage.cs
- InvokeProviderWrapper.cs
- TableLayoutRowStyleCollection.cs
- BindingContext.cs
- SqlDataReader.cs
- FileInfo.cs
- WebReferenceOptions.cs
- XmlKeywords.cs
- ClientBuildManager.cs
- CalendarDesigner.cs
- ServiceSecurityAuditBehavior.cs
- GridViewColumn.cs
- SqlCachedBuffer.cs
- FixedDSBuilder.cs
- ConfigurationSectionGroupCollection.cs
- ModelEditingScope.cs
- SoapSchemaImporter.cs
- ParserExtension.cs
- ISO2022Encoding.cs
- ElementProxy.cs
- ExpressionVisitor.cs
- BufferedGraphics.cs
- CultureData.cs
- UniqueConstraint.cs
- DiagnosticsConfiguration.cs
- PersonalizableTypeEntry.cs
- TargetConverter.cs
- ArrangedElement.cs
- SqlGenericUtil.cs
- SchemaManager.cs
- UserControlCodeDomTreeGenerator.cs
- EnumConverter.cs
- QilXmlReader.cs
- DisposableCollectionWrapper.cs
- ServiceOperation.cs
- FirstMatchCodeGroup.cs
- FormsAuthenticationUserCollection.cs
- IconBitmapDecoder.cs
- SafeEventLogWriteHandle.cs
- ScriptRegistrationManager.cs
- ServiceThrottlingBehavior.cs
- FocusWithinProperty.cs
- VBIdentifierTrimConverter.cs
- ZipIOLocalFileBlock.cs
- TextDecoration.cs
- ControlValuePropertyAttribute.cs
- DBSchemaTable.cs
- CfgParser.cs
- PathHelper.cs
- UrlMappingsSection.cs
- CheckBoxFlatAdapter.cs
- ApplicationHost.cs
- ErasingStroke.cs
- MailBnfHelper.cs
- BlobPersonalizationState.cs
- HtmlButton.cs
- TableMethodGenerator.cs
- RealProxy.cs
- ListViewItem.cs
- ToolboxService.cs
- SqlStream.cs
- TraceListeners.cs
- SyndicationFeed.cs
- MeasurementDCInfo.cs
- Profiler.cs
- Action.cs
- SatelliteContractVersionAttribute.cs