Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewRowConverter.cs / 1 / DataGridViewRowConverter.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.Drawing; using System.Diagnostics; using System.Globalization; using System.Reflection; internal class DataGridViewRowConverter : ExpandableObjectConverter { public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(InstanceDescriptor)) { return true; } return base.CanConvertTo(context, destinationType); } ////// 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"); } DataGridViewRow dataGridViewRow = value as DataGridViewRow; if (destinationType == typeof(InstanceDescriptor) && dataGridViewRow != null) { // public DataGridViewRow() // ConstructorInfo ctor = dataGridViewRow.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
- ConfigsHelper.cs
- RenderData.cs
- HierarchicalDataBoundControl.cs
- IODescriptionAttribute.cs
- SqlDependencyUtils.cs
- XmlQuerySequence.cs
- BufferAllocator.cs
- RegistryKey.cs
- BamlLocalizer.cs
- MailDefinitionBodyFileNameEditor.cs
- MessageHeaders.cs
- PrintPreviewGraphics.cs
- EmptyStringExpandableObjectConverter.cs
- RayHitTestParameters.cs
- Int16Animation.cs
- ProxyWebPartManagerDesigner.cs
- ResolveNameEventArgs.cs
- XmlILConstructAnalyzer.cs
- SchemaTableOptionalColumn.cs
- BuildProvidersCompiler.cs
- MediaContext.cs
- Point4D.cs
- FontFamilyIdentifier.cs
- SymbolTable.cs
- MimeTypeAttribute.cs
- ErrorFormatter.cs
- HtmlSelect.cs
- ConfigurationLocationCollection.cs
- TraceSection.cs
- EdmEntityTypeAttribute.cs
- srgsitem.cs
- FrameworkContentElementAutomationPeer.cs
- PersonalizationState.cs
- XmlCountingReader.cs
- XmlMapping.cs
- ConsoleKeyInfo.cs
- CacheForPrimitiveTypes.cs
- HMACMD5.cs
- FileLoadException.cs
- AlternateViewCollection.cs
- TimeStampChecker.cs
- SerializationSectionGroup.cs
- SecurityUtils.cs
- ConfigXmlAttribute.cs
- EventManager.cs
- SqlAggregateChecker.cs
- MemberAssignment.cs
- TextDecorationLocationValidation.cs
- XmlTextReaderImplHelpers.cs
- RSAPKCS1SignatureFormatter.cs
- SHA512.cs
- PreProcessInputEventArgs.cs
- LocalizationParserHooks.cs
- StringSource.cs
- ToolStripDropDownMenu.cs
- ButtonChrome.cs
- XmlUTF8TextReader.cs
- PassportAuthenticationEventArgs.cs
- FixedSOMLineRanges.cs
- StateWorkerRequest.cs
- CssTextWriter.cs
- GPPOINTF.cs
- Pair.cs
- TagMapCollection.cs
- PathGeometry.cs
- InternalRelationshipCollection.cs
- Variant.cs
- DataGridViewImageCell.cs
- Control.cs
- TypographyProperties.cs
- Timer.cs
- ChangeProcessor.cs
- Vector3DAnimationBase.cs
- DataBoundLiteralControl.cs
- FileEnumerator.cs
- FreezableOperations.cs
- RadioButtonList.cs
- ApplicationHost.cs
- XslAst.cs
- DBSqlParser.cs
- HwndHostAutomationPeer.cs
- TreeViewCancelEvent.cs
- LayoutEngine.cs
- AbstractDataSvcMapFileLoader.cs
- SBCSCodePageEncoding.cs
- EnumerableRowCollectionExtensions.cs
- FragmentQuery.cs
- MembershipSection.cs
- EdmProperty.cs
- SafeHandles.cs
- Speller.cs
- DesignerActionUIStateChangeEventArgs.cs
- Reference.cs
- QueryAsyncResult.cs
- LinkArea.cs
- MonitorWrapper.cs
- SecurityContext.cs
- MeasurementDCInfo.cs
- RankException.cs
- NotCondition.cs