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
- webeventbuffer.cs
- TargetPerspective.cs
- XhtmlBasicCommandAdapter.cs
- MethodExpr.cs
- TemplatePropertyEntry.cs
- XmlSerializerObjectSerializer.cs
- ElementHost.cs
- MailWebEventProvider.cs
- XhtmlBasicCalendarAdapter.cs
- Literal.cs
- SqlClientWrapperSmiStreamChars.cs
- ListItemsCollectionEditor.cs
- PagerSettings.cs
- TCEAdapterGenerator.cs
- DefaultCompensation.cs
- SmiEventStream.cs
- TracingConnectionListener.cs
- SerializationTrace.cs
- DbgUtil.cs
- XmlBufferReader.cs
- Rect3D.cs
- XmlWrappingReader.cs
- OdbcParameterCollection.cs
- DecimalConstantAttribute.cs
- QuaternionConverter.cs
- DisableDpiAwarenessAttribute.cs
- Literal.cs
- DynamicDataRouteHandler.cs
- WinEventWrap.cs
- BlurEffect.cs
- RoleService.cs
- TrueReadOnlyCollection.cs
- FileAuthorizationModule.cs
- ADConnectionHelper.cs
- CodeAttributeDeclaration.cs
- XamlWriter.cs
- NavigatorInvalidBodyAccessException.cs
- TraceData.cs
- NameValueSectionHandler.cs
- CookieProtection.cs
- TraceEventCache.cs
- GlyphShapingProperties.cs
- DbDataReader.cs
- ApplicationSecurityManager.cs
- OdbcFactory.cs
- SqlConnectionString.cs
- HttpsTransportElement.cs
- Nullable.cs
- DataGridViewColumnConverter.cs
- _NegoStream.cs
- BrushValueSerializer.cs
- bidPrivateBase.cs
- XPathNodeInfoAtom.cs
- WeakReferenceList.cs
- AppSettingsExpressionBuilder.cs
- ExpressionBindings.cs
- XmlDictionaryString.cs
- Sequence.cs
- WriterOutput.cs
- IdleTimeoutMonitor.cs
- IsolatedStoragePermission.cs
- DrawingAttributesDefaultValueFactory.cs
- LocalTransaction.cs
- AuthStoreRoleProvider.cs
- XmlILModule.cs
- StorageAssociationTypeMapping.cs
- MetadataArtifactLoaderCompositeResource.cs
- DataGridColumnHeadersPresenter.cs
- PageAdapter.cs
- XmlAtomErrorReader.cs
- UnknownWrapper.cs
- ValueSerializer.cs
- TextTreeInsertElementUndoUnit.cs
- SplitContainer.cs
- ReflectionServiceProvider.cs
- AdPostCacheSubstitution.cs
- IntellisenseTextBox.designer.cs
- KnownColorTable.cs
- MailWriter.cs
- SafeNativeMethods.cs
- ExpressionBuilder.cs
- MD5.cs
- Keyboard.cs
- OleDbRowUpdatingEvent.cs
- AnnotationHelper.cs
- BindingSource.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- TypeConverter.cs
- MenuRendererStandards.cs
- FontSource.cs
- ListMarkerSourceInfo.cs
- TreeNodeMouseHoverEvent.cs
- BaseInfoTable.cs
- WMIGenerator.cs
- TrackingExtract.cs
- RsaSecurityTokenAuthenticator.cs
- MimePart.cs
- Rule.cs
- TemplatePropertyEntry.cs
- ContextStaticAttribute.cs