Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- OutputCacheSettingsSection.cs
- ConstraintConverter.cs
- ActivitySurrogate.cs
- ListBase.cs
- IncrementalHitTester.cs
- IncrementalReadDecoders.cs
- XmlSchemaObjectCollection.cs
- ViewManager.cs
- CodeGen.cs
- WindowVisualStateTracker.cs
- DataKeyCollection.cs
- ExceptionHelpers.cs
- ValueConversionAttribute.cs
- PeerNameResolver.cs
- TextRangeEditTables.cs
- ChtmlTextWriter.cs
- CapabilitiesRule.cs
- ExceptionUtil.cs
- WebResponse.cs
- FontFamilyValueSerializer.cs
- DbConnectionPoolGroupProviderInfo.cs
- RotationValidation.cs
- SoapHttpTransportImporter.cs
- GlyphCache.cs
- TransformCollection.cs
- XmlDataSourceDesigner.cs
- EventRoute.cs
- MsmqInputChannel.cs
- Grammar.cs
- ResourceManagerWrapper.cs
- PackageRelationshipSelector.cs
- TemplatePagerField.cs
- InstanceData.cs
- CodeCompileUnit.cs
- EmulateRecognizeCompletedEventArgs.cs
- Assembly.cs
- OracleFactory.cs
- Visual3D.cs
- DrawingBrush.cs
- ProtocolElementCollection.cs
- MatchingStyle.cs
- Ref.cs
- HMAC.cs
- Page.cs
- CompilerErrorCollection.cs
- XmlCharCheckingWriter.cs
- ReferenceService.cs
- SqlBooleanizer.cs
- MergeExecutor.cs
- ObfuscationAttribute.cs
- FontFamily.cs
- ButtonFlatAdapter.cs
- CodeIdentifier.cs
- WindowsTitleBar.cs
- _TransmitFileOverlappedAsyncResult.cs
- ContentFilePart.cs
- VectorAnimationUsingKeyFrames.cs
- OutOfMemoryException.cs
- ValueConversionAttribute.cs
- RegexParser.cs
- RegisteredHiddenField.cs
- SettingsProperty.cs
- securitymgrsite.cs
- PerfService.cs
- PanelDesigner.cs
- VScrollProperties.cs
- OleCmdHelper.cs
- XmlSchemaAppInfo.cs
- WebServiceParameterData.cs
- ParseChildrenAsPropertiesAttribute.cs
- XmlEncApr2001.cs
- _OverlappedAsyncResult.cs
- MouseWheelEventArgs.cs
- GridEntryCollection.cs
- WindowsFormsHostPropertyMap.cs
- XPathSelectionIterator.cs
- FontStretches.cs
- Type.cs
- TargetControlTypeCache.cs
- messageonlyhwndwrapper.cs
- XPathPatternBuilder.cs
- XmlNamespaceMappingCollection.cs
- Profiler.cs
- ScrollBar.cs
- TimeSpanMinutesConverter.cs
- CanonicalFontFamilyReference.cs
- ModelTypeConverter.cs
- updatecommandorderer.cs
- OdbcPermission.cs
- OracleParameter.cs
- SafeFileMapViewHandle.cs
- NavigationEventArgs.cs
- DesignerAdRotatorAdapter.cs
- UnsafeNativeMethodsMilCoreApi.cs
- ToolStripPanelRenderEventArgs.cs
- ConditionalBranch.cs
- TokenBasedSetEnumerator.cs
- ScrollProviderWrapper.cs
- OperatingSystem.cs
- UntrustedRecipientException.cs