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
- AvtEvent.cs
- TargetException.cs
- BehaviorEditorPart.cs
- LinqDataSourceDisposeEventArgs.cs
- DeleteCardRequest.cs
- RoutedEventHandlerInfo.cs
- DesignerSelectionListAdapter.cs
- HyperLinkColumn.cs
- PreProcessor.cs
- MissingMemberException.cs
- AnnotationResource.cs
- ParameterModifier.cs
- ThreadStateException.cs
- SystemWebCachingSectionGroup.cs
- ToolStripItem.cs
- InputProviderSite.cs
- PackageStore.cs
- XamlPathDataSerializer.cs
- SoapObjectWriter.cs
- ClientBuildManager.cs
- PackagePart.cs
- ObjectStorage.cs
- ViewCellSlot.cs
- CanExecuteRoutedEventArgs.cs
- MissingMethodException.cs
- PtsHelper.cs
- SEHException.cs
- TabItemWrapperAutomationPeer.cs
- documentation.cs
- XslTransform.cs
- MutableAssemblyCacheEntry.cs
- ToolStripHighContrastRenderer.cs
- MemberAssignmentAnalysis.cs
- DataControlCommands.cs
- DBParameter.cs
- SafeTimerHandle.cs
- BrowserCapabilitiesCompiler.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- DocumentSignatureManager.cs
- DiscreteKeyFrames.cs
- UniqueConstraint.cs
- Parallel.cs
- ByteRangeDownloader.cs
- HttpFileCollection.cs
- XmlWrappingReader.cs
- CategoryAttribute.cs
- Bezier.cs
- CfgArc.cs
- COM2EnumConverter.cs
- TypeValidationEventArgs.cs
- EncoderParameters.cs
- ConfigXmlAttribute.cs
- OracleInfoMessageEventArgs.cs
- XmlReaderSettings.cs
- AnimatedTypeHelpers.cs
- ExpressionPrefixAttribute.cs
- FormsAuthenticationConfiguration.cs
- SecurityDescriptor.cs
- SapiRecoContext.cs
- TrackingMemoryStreamFactory.cs
- UniqueConstraint.cs
- Thumb.cs
- CustomAssemblyResolver.cs
- SystemInfo.cs
- ShapingWorkspace.cs
- ScrollPattern.cs
- DbConnectionHelper.cs
- RawTextInputReport.cs
- CompositeActivityTypeDescriptor.cs
- SupportingTokenAuthenticatorSpecification.cs
- SystemWebCachingSectionGroup.cs
- Schema.cs
- BmpBitmapDecoder.cs
- DbParameterCollection.cs
- OptimizerPatterns.cs
- StorageSetMapping.cs
- AutomationIdentifierGuids.cs
- ColumnMap.cs
- ColorAnimation.cs
- ContentPlaceHolder.cs
- NamedPipeConnectionPoolSettingsElement.cs
- ETagAttribute.cs
- IsolatedStorageException.cs
- SecurityRuntime.cs
- MembershipValidatePasswordEventArgs.cs
- TargetConverter.cs
- Bitmap.cs
- TemplateXamlTreeBuilder.cs
- WorkflowViewService.cs
- StringInfo.cs
- HtmlToClrEventProxy.cs
- SqlBooleanizer.cs
- QuotedPrintableStream.cs
- CardSpaceShim.cs
- _ConnectionGroup.cs
- FixedPage.cs
- DomainUpDown.cs
- DoubleLinkList.cs
- CompositeFontFamily.cs
- ExpressionBindings.cs