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
- LogicalExpr.cs
- Control.cs
- Subtree.cs
- ClientConfigPaths.cs
- ClientSideProviderDescription.cs
- WebFaultException.cs
- ObjectDataSourceMethodEventArgs.cs
- ComboBox.cs
- ZipPackagePart.cs
- AppDomainAttributes.cs
- EndpointDiscoveryMetadataCD1.cs
- ListBox.cs
- Baml2006KnownTypes.cs
- HtmlInputCheckBox.cs
- DataSourceCache.cs
- TrustManager.cs
- UpdateManifestForBrowserApplication.cs
- EdmFunctionAttribute.cs
- ToolStripEditorManager.cs
- SettingsSavedEventArgs.cs
- SiteMapNodeItemEventArgs.cs
- EntityClientCacheKey.cs
- BitmapEffectInput.cs
- XPathBuilder.cs
- ConditionCollection.cs
- CharUnicodeInfo.cs
- RSAOAEPKeyExchangeDeformatter.cs
- Rfc2898DeriveBytes.cs
- ComponentConverter.cs
- TextEndOfParagraph.cs
- StringValidatorAttribute.cs
- InvalidOleVariantTypeException.cs
- ApplicationServiceManager.cs
- ValidationEventArgs.cs
- _HeaderInfoTable.cs
- SEHException.cs
- ObjectCloneHelper.cs
- SizeFConverter.cs
- CombinedGeometry.cs
- FilterEventArgs.cs
- GPStream.cs
- TableCellAutomationPeer.cs
- SaveFileDialog.cs
- ProcessProtocolHandler.cs
- ActiveXMessageFormatter.cs
- InvalidDataException.cs
- DataGridViewImageCell.cs
- DateTimeSerializationSection.cs
- SecUtil.cs
- OdbcCommand.cs
- CompilationLock.cs
- DesignerTransaction.cs
- CorrelationValidator.cs
- ResourcePermissionBase.cs
- XPathCompileException.cs
- ObjRef.cs
- DeferredRunTextReference.cs
- Calendar.cs
- SmtpNetworkElement.cs
- XmlNodeChangedEventManager.cs
- AncillaryOps.cs
- ListBindingHelper.cs
- FilterException.cs
- ColorInterpolationModeValidation.cs
- XmlSequenceWriter.cs
- RelatedPropertyManager.cs
- OrderedDictionaryStateHelper.cs
- SiteIdentityPermission.cs
- SpecularMaterial.cs
- CodeTypeOfExpression.cs
- IdentityManager.cs
- CorrelationManager.cs
- BindingOperations.cs
- CreateUserWizardStep.cs
- CodeMemberProperty.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- Hash.cs
- UserControlAutomationPeer.cs
- BamlLocalizationDictionary.cs
- CompilerGeneratedAttribute.cs
- DataAdapter.cs
- TempFiles.cs
- TypeBuilder.cs
- StaticFileHandler.cs
- Encoder.cs
- TemplatedWizardStep.cs
- MessageEncodingBindingElement.cs
- InternalControlCollection.cs
- HorizontalAlignConverter.cs
- StateDesigner.cs
- BitmapEffectDrawing.cs
- PrimitiveRenderer.cs
- PointCollection.cs
- CommandHelpers.cs
- SqlNodeTypeOperators.cs
- RelationshipManager.cs
- HttpContextServiceHost.cs
- arc.cs
- ImportFileRequest.cs
- RegisteredDisposeScript.cs