Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / CompMod / System / ComponentModel / CollectionConverter.cs / 1 / CollectionConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using Microsoft.Win32; using System.Collections; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Runtime.Serialization.Formatters; using System.Runtime.Remoting; using System.Runtime.InteropServices; using System.Security.Permissions; ////// [HostProtection(SharedState = true)] public class CollectionConverter : TypeConverter { ///Provides a type converter to convert /// collection objects to and from various other representations. ////// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == null) { throw new ArgumentNullException("destinationType"); } if (destinationType == typeof(string)) { if (value is ICollection) { return SR.GetString(SR.CollectionConverterText); } } return base.ConvertTo(context, culture, value, destinationType); } ///Converts the given /// value object to the /// specified destination type. ////// public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) { //return new PropertyDescriptorCollection(null); return null; } ///Gets a collection of properties for /// the type of array specified by the value parameter using the specified context and /// attributes. ////// public override bool GetPropertiesSupported(ITypeDescriptorContext context) { return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //Gets a value indicating whether this object /// supports properties. ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using Microsoft.Win32; using System.Collections; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Runtime.Serialization.Formatters; using System.Runtime.Remoting; using System.Runtime.InteropServices; using System.Security.Permissions; ////// [HostProtection(SharedState = true)] public class CollectionConverter : TypeConverter { ///Provides a type converter to convert /// collection objects to and from various other representations. ////// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == null) { throw new ArgumentNullException("destinationType"); } if (destinationType == typeof(string)) { if (value is ICollection) { return SR.GetString(SR.CollectionConverterText); } } return base.ConvertTo(context, culture, value, destinationType); } ///Converts the given /// value object to the /// specified destination type. ////// public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) { //return new PropertyDescriptorCollection(null); return null; } ///Gets a collection of properties for /// the type of array specified by the value parameter using the specified context and /// attributes. ////// public override bool GetPropertiesSupported(ITypeDescriptorContext context) { return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.Gets a value indicating whether this object /// supports properties. ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FilteredReadOnlyMetadataCollection.cs
- Thumb.cs
- MailWebEventProvider.cs
- LinqDataSourceUpdateEventArgs.cs
- XmlAttributeCache.cs
- ObservableDictionary.cs
- LiteralText.cs
- DataIdProcessor.cs
- BlurBitmapEffect.cs
- Menu.cs
- AssemblyNameProxy.cs
- TreeView.cs
- DynamicResourceExtension.cs
- GridItemPatternIdentifiers.cs
- Point4DConverter.cs
- SchemaCollectionPreprocessor.cs
- WebPartAuthorizationEventArgs.cs
- TextBox.cs
- WebBaseEventKeyComparer.cs
- XPathSelfQuery.cs
- XamlInt32CollectionSerializer.cs
- InputBinder.cs
- ThicknessAnimation.cs
- Rect.cs
- BitmapScalingModeValidation.cs
- GetPageNumberCompletedEventArgs.cs
- Thread.cs
- X509Chain.cs
- SQLBytesStorage.cs
- Repeater.cs
- CodeDOMUtility.cs
- documentsequencetextview.cs
- BaseParser.cs
- Merger.cs
- ConfigurationStrings.cs
- ZoomPercentageConverter.cs
- AttributeCollection.cs
- FilteredXmlReader.cs
- LoginUtil.cs
- ProgramNode.cs
- ChannelParameterCollection.cs
- OuterGlowBitmapEffect.cs
- GorillaCodec.cs
- KnownTypesHelper.cs
- altserialization.cs
- ExpressionBuilderCollection.cs
- EntityDataSourceSelectedEventArgs.cs
- XmlReaderSettings.cs
- ConfigsHelper.cs
- TemplatePagerField.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- DefaultHttpHandler.cs
- DataAdapter.cs
- RepeatButton.cs
- DefaultValidator.cs
- PolygonHotSpot.cs
- DataControlButton.cs
- IndexedEnumerable.cs
- NamespaceInfo.cs
- SQLDecimalStorage.cs
- ZipIOBlockManager.cs
- ImageSource.cs
- ZeroOpNode.cs
- WindowExtensionMethods.cs
- GestureRecognitionResult.cs
- PeerNeighborManager.cs
- CreateUserErrorEventArgs.cs
- MethodAccessException.cs
- DataGridViewComboBoxEditingControl.cs
- EntityDataSourceEntityTypeFilterItem.cs
- _ListenerResponseStream.cs
- TemplateDefinition.cs
- CodeDomDesignerLoader.cs
- PathTooLongException.cs
- CursorConverter.cs
- Shape.cs
- ServiceNameElement.cs
- DataGridCellAutomationPeer.cs
- PropertyMetadata.cs
- PlainXmlDeserializer.cs
- LateBoundChannelParameterCollection.cs
- XmlSchemaSimpleContentRestriction.cs
- MenuAutomationPeer.cs
- SingleResultAttribute.cs
- DrawingGroup.cs
- DataGridCellsPresenter.cs
- XamlHttpHandlerFactory.cs
- SystemFonts.cs
- SystemColors.cs
- RegexRunner.cs
- GridPattern.cs
- PowerStatus.cs
- SqlTypesSchemaImporter.cs
- NativeMethods.cs
- DataExpression.cs
- FormViewInsertEventArgs.cs
- RectangleConverter.cs
- ToolstripProfessionalRenderer.cs
- ImpersonationOption.cs
- ExpressionBuilderContext.cs