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
- clipboard.cs
- sqlinternaltransaction.cs
- BrowserCapabilitiesFactory.cs
- ProxyWebPartConnectionCollection.cs
- TreeNodeEventArgs.cs
- Validator.cs
- XmlSignificantWhitespace.cs
- MultiByteCodec.cs
- ButtonField.cs
- TdsParserSessionPool.cs
- RawAppCommandInputReport.cs
- TextBox.cs
- Misc.cs
- ThreadAbortException.cs
- XmlChoiceIdentifierAttribute.cs
- FixedSOMGroup.cs
- UTF7Encoding.cs
- StandardCommands.cs
- WorkflowEnvironment.cs
- basenumberconverter.cs
- SecurityVerifiedMessage.cs
- SymmetricKeyWrap.cs
- HttpApplication.cs
- Pair.cs
- FormatStringEditor.cs
- SizeAnimation.cs
- QueryableDataSourceEditData.cs
- DPTypeDescriptorContext.cs
- OdbcInfoMessageEvent.cs
- ActiveXContainer.cs
- BamlRecords.cs
- BaseContextMenu.cs
- WebPartDisplayModeCollection.cs
- ExtentCqlBlock.cs
- WindowsIdentity.cs
- PropertySourceInfo.cs
- PolyBezierSegment.cs
- AnimationLayer.cs
- ValidationErrorEventArgs.cs
- ItemContainerGenerator.cs
- DelegateSerializationHolder.cs
- RedirectionProxy.cs
- Gdiplus.cs
- IisTraceListener.cs
- DataSourceViewSchemaConverter.cs
- RecordsAffectedEventArgs.cs
- RequestQueue.cs
- AttributeParameterInfo.cs
- WS2007FederationHttpBinding.cs
- InstanceNotReadyException.cs
- PriorityRange.cs
- ToolStripAdornerWindowService.cs
- DockingAttribute.cs
- RecordManager.cs
- ServiceNameElement.cs
- DataTemplateSelector.cs
- ClipboardData.cs
- Fx.cs
- IFlowDocumentViewer.cs
- ProxyElement.cs
- Transform.cs
- CustomAttribute.cs
- IdentityNotMappedException.cs
- QuaternionAnimation.cs
- SQLMoneyStorage.cs
- CreationContext.cs
- WindowsButton.cs
- ImageCreator.cs
- DataGridViewCellConverter.cs
- InputManager.cs
- ServiceChannelFactory.cs
- InternalSafeNativeMethods.cs
- LinqDataSourceHelper.cs
- SystemDropShadowChrome.cs
- WindowsGraphics.cs
- FormParameter.cs
- TextEditorParagraphs.cs
- ActionItem.cs
- TextContainerChangedEventArgs.cs
- WebInvokeAttribute.cs
- AutomationFocusChangedEventArgs.cs
- MobileRedirect.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- ListBoxAutomationPeer.cs
- SqlDataSourceEnumerator.cs
- WindowsGraphicsCacheManager.cs
- HttpProfileBase.cs
- DeobfuscatingStream.cs
- WebPartTracker.cs
- ImmutableClientRuntime.cs
- ZipIOCentralDirectoryBlock.cs
- CodeIdentifier.cs
- DataRecordInfo.cs
- TextProperties.cs
- SecurityIdentifierElementCollection.cs
- DataKey.cs
- ConnectionsZone.cs
- VBIdentifierNameEditor.cs
- ContravarianceAdapter.cs
- TextDecorations.cs