Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- TypefaceMap.cs
- ProtocolElementCollection.cs
- ArrangedElement.cs
- TextRangeEdit.cs
- PrintingPermissionAttribute.cs
- Ipv6Element.cs
- FormViewPagerRow.cs
- DesignerDataStoredProcedure.cs
- AppDomainCompilerProxy.cs
- DataGridViewCellLinkedList.cs
- AppModelKnownContentFactory.cs
- QueueProcessor.cs
- Pair.cs
- Profiler.cs
- HtmlControlPersistable.cs
- TimestampInformation.cs
- PropertyStore.cs
- ItemContainerGenerator.cs
- ServiceThrottle.cs
- UIElement3DAutomationPeer.cs
- ObjectIDGenerator.cs
- ClientScriptManager.cs
- Timeline.cs
- Menu.cs
- AncestorChangedEventArgs.cs
- ContractCodeDomInfo.cs
- DbParameterCollectionHelper.cs
- PasswordRecovery.cs
- XMLSyntaxException.cs
- SQLGuid.cs
- Resources.Designer.cs
- safelink.cs
- DynamicDocumentPaginator.cs
- KeyboardNavigation.cs
- List.cs
- SortKey.cs
- OleTxTransaction.cs
- FrameSecurityDescriptor.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- LinqDataSource.cs
- DataStorage.cs
- XmlUtil.cs
- Decoder.cs
- SystemTcpConnection.cs
- EndOfStreamException.cs
- SqlDataSourceFilteringEventArgs.cs
- Perspective.cs
- BamlTreeMap.cs
- SymmetricKeyWrap.cs
- GridViewColumnHeader.cs
- AttachInfo.cs
- _ListenerAsyncResult.cs
- PathData.cs
- NamespaceDecl.cs
- BindingCollection.cs
- ClassHandlersStore.cs
- SignerInfo.cs
- WmlObjectListAdapter.cs
- LocalValueEnumerator.cs
- MessageSecurityTokenVersion.cs
- DataKeyArray.cs
- WebPartMenuStyle.cs
- XmlStringTable.cs
- SamlDoNotCacheCondition.cs
- WindowsStatusBar.cs
- TraceListener.cs
- ConnectionPoint.cs
- PriorityChain.cs
- FormViewUpdatedEventArgs.cs
- ObjectItemNoOpAssemblyLoader.cs
- ProcessThreadDesigner.cs
- WsatAdminException.cs
- BaseParagraph.cs
- TreeChangeInfo.cs
- RegistryPermission.cs
- HttpHandlerAction.cs
- DataGridViewSelectedRowCollection.cs
- InputBinder.cs
- EntityDesignerBuildProvider.cs
- EventProxy.cs
- Thread.cs
- Int16AnimationUsingKeyFrames.cs
- XomlSerializationHelpers.cs
- TypeKeyValue.cs
- FileDialogPermission.cs
- AuthStoreRoleProvider.cs
- FieldBuilder.cs
- ProxyAttribute.cs
- Exception.cs
- SelectionManager.cs
- SmtpFailedRecipientException.cs
- DependencyPropertyConverter.cs
- SafeNativeMethods.cs
- WebPartEditorApplyVerb.cs
- StatusBarPanel.cs
- MeasureItemEvent.cs
- FieldAccessException.cs
- UserControlBuildProvider.cs
- SharingService.cs
- BuildManagerHost.cs