Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / CollectionConverter.cs / 1305376 / 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
- Image.cs
- ComponentEvent.cs
- AsyncCompletedEventArgs.cs
- TextProviderWrapper.cs
- CanExecuteRoutedEventArgs.cs
- LookupNode.cs
- DispatcherFrame.cs
- UdpContractFilterBehavior.cs
- ImportCatalogPart.cs
- StyleBamlTreeBuilder.cs
- PageThemeCodeDomTreeGenerator.cs
- DataGridViewTextBoxColumn.cs
- TemplateFactory.cs
- SymbolResolver.cs
- CodeMemberMethod.cs
- EventLogEntryCollection.cs
- WCFBuildProvider.cs
- SafeReversePInvokeHandle.cs
- FunctionDetailsReader.cs
- RecipientInfo.cs
- XmlQueryRuntime.cs
- DoubleAnimationClockResource.cs
- ByteStorage.cs
- CalendarTable.cs
- SqlDataSourceTableQuery.cs
- IntegerFacetDescriptionElement.cs
- ProgressPage.cs
- SimpleWebHandlerParser.cs
- HtmlInputButton.cs
- XmlLinkedNode.cs
- DataGridViewCellEventArgs.cs
- EditorOptionAttribute.cs
- JsonFormatReaderGenerator.cs
- GroupItem.cs
- DesignerLoader.cs
- XmlSchemaNotation.cs
- CustomWebEventKey.cs
- FormsAuthenticationUser.cs
- Monitor.cs
- TraceListener.cs
- FormClosingEvent.cs
- TextLineBreak.cs
- CodeAccessSecurityEngine.cs
- ConstructorArgumentAttribute.cs
- WorkflowQueueInfo.cs
- GridErrorDlg.cs
- ApplicationInfo.cs
- AuthenticationException.cs
- EdgeModeValidation.cs
- smtpconnection.cs
- WebPartsSection.cs
- Comparer.cs
- AssociationProvider.cs
- Console.cs
- LogSwitch.cs
- XmlIlTypeHelper.cs
- StubHelpers.cs
- XmlAttributeProperties.cs
- StateMachineWorkflow.cs
- PerformanceCounter.cs
- SettingsPropertyValueCollection.cs
- TextRunCacheImp.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- SByteStorage.cs
- OdbcException.cs
- OdbcParameter.cs
- PartitionerQueryOperator.cs
- TypeListConverter.cs
- RelationshipEnd.cs
- FrameAutomationPeer.cs
- BStrWrapper.cs
- ChannelManager.cs
- PagerStyle.cs
- DictionaryBase.cs
- MultiSelectRootGridEntry.cs
- WebPartManagerInternals.cs
- SiteMapDataSourceView.cs
- BufferModesCollection.cs
- EndEvent.cs
- HtmlInputReset.cs
- ContainerParagraph.cs
- DirectoryNotFoundException.cs
- ClientUrlResolverWrapper.cs
- StickyNoteAnnotations.cs
- InputScopeManager.cs
- ButtonField.cs
- DispatcherExceptionEventArgs.cs
- ViewManager.cs
- Label.cs
- ColumnWidthChangedEvent.cs
- VirtualPathUtility.cs
- CodeNamespaceCollection.cs
- ObfuscateAssemblyAttribute.cs
- ContentElement.cs
- RequestCachePolicyConverter.cs
- StopStoryboard.cs
- WSSecurityXXX2005.cs
- RoleService.cs
- LifetimeServices.cs
- Misc.cs