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
- ServerTooBusyException.cs
- ThrowHelper.cs
- XPathDocumentBuilder.cs
- BrowserDefinition.cs
- NegatedConstant.cs
- PersonalizationStateInfoCollection.cs
- ImageSource.cs
- WebFaultClientMessageInspector.cs
- SafeUserTokenHandle.cs
- XmlSchemaExporter.cs
- CompilationRelaxations.cs
- DataServiceContext.cs
- PersonalizationAdministration.cs
- TypedRowHandler.cs
- IdentifierService.cs
- WebCategoryAttribute.cs
- FontFamilyIdentifier.cs
- WorkflowTraceTransfer.cs
- Funcletizer.cs
- ItemContainerGenerator.cs
- RequestQueue.cs
- WebHttpBinding.cs
- XmlAnyElementAttribute.cs
- _NTAuthentication.cs
- XPathException.cs
- remotingproxy.cs
- PropertyChangedEventManager.cs
- PathParser.cs
- FlowDocumentView.cs
- RenderData.cs
- AmbientProperties.cs
- EventSetterHandlerConverter.cs
- Style.cs
- ComponentCollection.cs
- ObjectListItem.cs
- TabRenderer.cs
- CheckBox.cs
- DesignerActionHeaderItem.cs
- IRCollection.cs
- RemoteWebConfigurationHostStream.cs
- SupportsEventValidationAttribute.cs
- ConfigurationSectionCollection.cs
- DropShadowEffect.cs
- CodeDirectionExpression.cs
- DbDataRecord.cs
- StylusButtonEventArgs.cs
- StylusPlugin.cs
- BindingNavigator.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- KnownBoxes.cs
- XPathParser.cs
- WorkflowStateRollbackService.cs
- BulletedListEventArgs.cs
- StorageBasedPackageProperties.cs
- CompensationExtension.cs
- CmsInterop.cs
- VisualTreeHelper.cs
- XmlSortKeyAccumulator.cs
- InfoCardSymmetricAlgorithm.cs
- SecurityManager.cs
- BitmapFrameEncode.cs
- _NetworkingPerfCounters.cs
- ImageClickEventArgs.cs
- XamlToRtfParser.cs
- COM2EnumConverter.cs
- DeferredSelectedIndexReference.cs
- SqlResolver.cs
- UrlMappingsModule.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- HwndAppCommandInputProvider.cs
- Version.cs
- __Filters.cs
- ScaleTransform3D.cs
- CapabilitiesRule.cs
- WorkflowItemPresenter.cs
- WebPartMinimizeVerb.cs
- AnnotationService.cs
- ListBoxItemWrapperAutomationPeer.cs
- HttpApplicationStateBase.cs
- NonBatchDirectoryCompiler.cs
- RtfToXamlLexer.cs
- RewritingSimplifier.cs
- NetworkInterface.cs
- StrokeCollectionDefaultValueFactory.cs
- WebDisplayNameAttribute.cs
- UIElementPropertyUndoUnit.cs
- TextPointerBase.cs
- HitTestWithPointDrawingContextWalker.cs
- RequestQueue.cs
- HttpContextServiceHost.cs
- WebBrowserNavigatingEventHandler.cs
- EndPoint.cs
- DataColumn.cs
- MasterPage.cs
- MenuRendererStandards.cs
- MessageSecurityOverMsmq.cs
- SelectedCellsCollection.cs
- XsltLibrary.cs
- ScriptServiceAttribute.cs
- SelectionProviderWrapper.cs