Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- XPathNodeList.cs
- ThemeableAttribute.cs
- datacache.cs
- FormatStringEditor.cs
- RuleProcessor.cs
- DataBindingHandlerAttribute.cs
- XmlSchemaInfo.cs
- SchemaReference.cs
- XPathSelectionIterator.cs
- RepeaterItem.cs
- GuidTagList.cs
- QilCloneVisitor.cs
- CommonProperties.cs
- DefaultWorkflowSchedulerService.cs
- ExclusiveCanonicalizationTransform.cs
- filewebresponse.cs
- ViewgenGatekeeper.cs
- ManualResetEvent.cs
- Axis.cs
- TrackingLocation.cs
- DesignerVerb.cs
- DesignerExtenders.cs
- BindingGroup.cs
- PointAnimationUsingKeyFrames.cs
- RegexGroup.cs
- UIServiceHelper.cs
- RuleCache.cs
- ConstNode.cs
- FileDialogPermission.cs
- WebServiceAttribute.cs
- TreeNodeBinding.cs
- BrowserCapabilitiesCodeGenerator.cs
- SettingsSection.cs
- WebPartDisplayMode.cs
- XmlAttributeAttribute.cs
- CharacterBufferReference.cs
- ReflectPropertyDescriptor.cs
- ADConnectionHelper.cs
- DesignerOptionService.cs
- CurrentChangingEventArgs.cs
- DataListItemCollection.cs
- ManagementObject.cs
- ListViewCommandEventArgs.cs
- StreamGeometry.cs
- Storyboard.cs
- ProcessModelInfo.cs
- TableLayoutCellPaintEventArgs.cs
- ExecutionProperties.cs
- DesignerHierarchicalDataSourceView.cs
- SplashScreenNativeMethods.cs
- OraclePermission.cs
- PersonalizationStateQuery.cs
- DBCommandBuilder.cs
- AudioFormatConverter.cs
- SamlAssertion.cs
- ToolStripScrollButton.cs
- FilteredDataSetHelper.cs
- MeshGeometry3D.cs
- Separator.cs
- FullTextState.cs
- XmlIgnoreAttribute.cs
- ApplicationDirectoryMembershipCondition.cs
- ChineseLunisolarCalendar.cs
- MdiWindowListStrip.cs
- DifferencingCollection.cs
- OrthographicCamera.cs
- PeerNodeAddress.cs
- MULTI_QI.cs
- _BaseOverlappedAsyncResult.cs
- StaticFileHandler.cs
- SqlReorderer.cs
- StringExpressionSet.cs
- SecurityDocument.cs
- CallbackHandler.cs
- WebConfigurationManager.cs
- IPipelineRuntime.cs
- ApplicationGesture.cs
- SelectionItemProviderWrapper.cs
- XmlElementList.cs
- GiveFeedbackEvent.cs
- MobileFormsAuthentication.cs
- TrackingProfileSerializer.cs
- HtmlElementCollection.cs
- InstanceData.cs
- OracleInternalConnection.cs
- WebPartZoneBase.cs
- AppSettingsReader.cs
- MarginCollapsingState.cs
- __FastResourceComparer.cs
- ColorInterpolationModeValidation.cs
- XmlNamespaceManager.cs
- JsonEncodingStreamWrapper.cs
- HwndKeyboardInputProvider.cs
- ArraySegment.cs
- SelectionEditingBehavior.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- TypeConverterValueSerializer.cs
- WindowVisualStateTracker.cs
- SymLanguageVendor.cs
- MarshalDirectiveException.cs