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
- MembershipSection.cs
- SEHException.cs
- CodeCatchClauseCollection.cs
- FileSystemEventArgs.cs
- PowerModeChangedEventArgs.cs
- DbConnectionFactory.cs
- TargetConverter.cs
- ButtonBaseAutomationPeer.cs
- XmlSortKey.cs
- Translator.cs
- InputManager.cs
- StylusSystemGestureEventArgs.cs
- RowVisual.cs
- DataSysAttribute.cs
- MethodCallTranslator.cs
- _DomainName.cs
- PageScaling.cs
- SoapSchemaExporter.cs
- ISessionStateStore.cs
- ManagementObjectSearcher.cs
- RectConverter.cs
- SymmetricSecurityProtocol.cs
- SchemaImporterExtension.cs
- InstanceValue.cs
- EventTrigger.cs
- GradientBrush.cs
- CorrelationManager.cs
- WorkflowInstance.cs
- SiteMapNode.cs
- HelpFileFileNameEditor.cs
- FullTextLine.cs
- ApplicationServiceManager.cs
- CommandDevice.cs
- ArraySet.cs
- ArrayMergeHelper.cs
- WindowsListViewItemCheckBox.cs
- DirectoryInfo.cs
- X509LogoTypeExtension.cs
- ComplexType.cs
- HttpPostedFile.cs
- Compiler.cs
- DocumentXPathNavigator.cs
- EmptyQuery.cs
- FontDialog.cs
- CodeCatchClauseCollection.cs
- CachingHintValidation.cs
- UnsafeNativeMethodsPenimc.cs
- RoutedUICommand.cs
- NameValueCollection.cs
- RoutingChannelExtension.cs
- ToolBar.cs
- UrlPropertyAttribute.cs
- RegisteredArrayDeclaration.cs
- LocalizableResourceBuilder.cs
- CallContext.cs
- SqlProcedureAttribute.cs
- OleDbTransaction.cs
- BitmapVisualManager.cs
- Timeline.cs
- TextServicesCompartment.cs
- RelativeSource.cs
- PageParser.cs
- AuthorizationSection.cs
- DetailsViewModeEventArgs.cs
- EventEntry.cs
- SQLInt16.cs
- AttributeCollection.cs
- ListViewItem.cs
- TransformCryptoHandle.cs
- NumericUpDown.cs
- AxisAngleRotation3D.cs
- TreeView.cs
- PriorityRange.cs
- StringSorter.cs
- DecimalFormatter.cs
- RelatedCurrencyManager.cs
- SQLDecimal.cs
- RelatedEnd.cs
- LinkDescriptor.cs
- Socket.cs
- ContainerFilterService.cs
- ReadOnlyCollection.cs
- DataGridViewToolTip.cs
- MD5HashHelper.cs
- _UncName.cs
- ClusterRegistryConfigurationProvider.cs
- KeyedHashAlgorithm.cs
- TouchFrameEventArgs.cs
- FormViewPagerRow.cs
- DataGridCellInfo.cs
- QueuePathEditor.cs
- RelatedEnd.cs
- GlyphRunDrawing.cs
- RowToFieldTransformer.cs
- SurrogateSelector.cs
- DataControlField.cs
- CodeAttachEventStatement.cs
- ThicknessConverter.cs
- WmlObjectListAdapter.cs
- HtmlTernaryTree.cs