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
- MetadataExchangeBindings.cs
- SerializationObjectManager.cs
- ConfigXmlAttribute.cs
- EntitySetDataBindingList.cs
- FileDialogCustomPlace.cs
- DbDeleteCommandTree.cs
- BinaryFormatter.cs
- WrappedReader.cs
- MemberRelationshipService.cs
- EntityDataSourceSelectedEventArgs.cs
- HtmlValidatorAdapter.cs
- BinaryObjectWriter.cs
- versioninfo.cs
- GridViewDesigner.cs
- XmlNodeReader.cs
- GiveFeedbackEvent.cs
- XmlRootAttribute.cs
- SmtpException.cs
- ListItem.cs
- DataServiceRequestOfT.cs
- SimpleType.cs
- SecurityTokenProvider.cs
- ModulesEntry.cs
- QueueNameHelper.cs
- SmtpSection.cs
- ControlCachePolicy.cs
- HtmlToClrEventProxy.cs
- IisTraceWebEventProvider.cs
- ToolStripRendererSwitcher.cs
- FontStretch.cs
- ConfigurationManagerHelper.cs
- DispatchWrapper.cs
- AnimationStorage.cs
- ExeContext.cs
- InfoCardMasterKey.cs
- WebControlToolBoxItem.cs
- WorkItem.cs
- GatewayDefinition.cs
- MemberPath.cs
- SpellerHighlightLayer.cs
- CodeGroup.cs
- recordstatefactory.cs
- SortQuery.cs
- HwndKeyboardInputProvider.cs
- DesignerForm.cs
- DispatcherSynchronizationContext.cs
- ServerIdentity.cs
- PersistenceTypeAttribute.cs
- StaticFileHandler.cs
- TextBreakpoint.cs
- MonthChangedEventArgs.cs
- ToolboxService.cs
- Translator.cs
- WebServiceClientProxyGenerator.cs
- IconConverter.cs
- MessageSecurityOverHttpElement.cs
- CompilerInfo.cs
- InsufficientMemoryException.cs
- ControllableStoryboardAction.cs
- StyleSelector.cs
- ISessionStateStore.cs
- SystemWebCachingSectionGroup.cs
- XmlSchemaGroupRef.cs
- TimeEnumHelper.cs
- QilTargetType.cs
- DataGridViewLinkCell.cs
- RbTree.cs
- LongMinMaxAggregationOperator.cs
- SqlParameter.cs
- WmfPlaceableFileHeader.cs
- SerializationSectionGroup.cs
- ListViewItem.cs
- HotSpotCollection.cs
- ParseElementCollection.cs
- CryptoApi.cs
- InternalMappingException.cs
- PropertyRecord.cs
- WindowClosedEventArgs.cs
- XmlILOptimizerVisitor.cs
- SeekableReadStream.cs
- webclient.cs
- ScriptingSectionGroup.cs
- TypefaceMap.cs
- ReflectPropertyDescriptor.cs
- LoopExpression.cs
- ImageAutomationPeer.cs
- SerializerDescriptor.cs
- Int64.cs
- RayMeshGeometry3DHitTestResult.cs
- UrlMappingsSection.cs
- HttpCachePolicyElement.cs
- AccessDataSourceView.cs
- SetIterators.cs
- File.cs
- SwitchElementsCollection.cs
- ElementHostAutomationPeer.cs
- SmiContextFactory.cs
- SqlProviderManifest.cs
- XmlByteStreamWriter.cs
- PriorityRange.cs