Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / CollectionConverter.cs / 1305376 / 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
- RegexCompilationInfo.cs
- initElementDictionary.cs
- SafeNativeMethods.cs
- CompiledRegexRunnerFactory.cs
- TextDpi.cs
- CqlGenerator.cs
- ValidationError.cs
- HttpHandlersSection.cs
- MessageDecoder.cs
- UserNameSecurityTokenParameters.cs
- Source.cs
- FilteredDataSetHelper.cs
- InkCanvasInnerCanvas.cs
- TraceContextRecord.cs
- ItemsPanelTemplate.cs
- WindowsListBox.cs
- FusionWrap.cs
- DataGridComponentEditor.cs
- EdmComplexTypeAttribute.cs
- Intellisense.cs
- Rotation3D.cs
- LoginCancelEventArgs.cs
- HttpCapabilitiesBase.cs
- ShapeTypeface.cs
- Delegate.cs
- TabletDeviceInfo.cs
- WindowsStartMenu.cs
- DbConnectionPoolGroup.cs
- ExpressionLink.cs
- FontFamilyConverter.cs
- LayoutDump.cs
- MenuBindingsEditorForm.cs
- CursorInteropHelper.cs
- ResXResourceReader.cs
- DeflateInput.cs
- HorizontalAlignConverter.cs
- ErrorsHelper.cs
- PerfCounters.cs
- SqlDataSourceConnectionPanel.cs
- NonValidatingSecurityTokenAuthenticator.cs
- RestHandler.cs
- XamlStackWriter.cs
- DispatcherExceptionEventArgs.cs
- WindowsGrip.cs
- OrderingQueryOperator.cs
- _Rfc2616CacheValidators.cs
- PageWrapper.cs
- SmiEventSink.cs
- ThreadInterruptedException.cs
- ValidatorCompatibilityHelper.cs
- Keyboard.cs
- nulltextnavigator.cs
- XmlBindingWorker.cs
- ContainerAction.cs
- OptimizedTemplateContent.cs
- SqlParameterCollection.cs
- WebRequestModuleElementCollection.cs
- webbrowsersite.cs
- DataGrid.cs
- KeyInstance.cs
- DoubleCollectionConverter.cs
- ServicePointManager.cs
- PropertyItemInternal.cs
- RtfToXamlReader.cs
- DirectoryNotFoundException.cs
- TreeNodeBinding.cs
- Error.cs
- GeneralTransform3DCollection.cs
- Maps.cs
- WinEventHandler.cs
- SettingsSavedEventArgs.cs
- TdsParserHelperClasses.cs
- AnnotationService.cs
- PartialToken.cs
- PaintEvent.cs
- Timer.cs
- AssemblyGen.cs
- OutputCache.cs
- Vector3DAnimation.cs
- LogWriteRestartAreaState.cs
- AddressingVersion.cs
- SoapAttributeAttribute.cs
- PeerFlooder.cs
- ObjectComplexPropertyMapping.cs
- SharedPersonalizationStateInfo.cs
- ReadOnlyMetadataCollection.cs
- HMACSHA256.cs
- ConfigurationStrings.cs
- SrgsRule.cs
- GenericsInstances.cs
- TypeReference.cs
- GeometryGroup.cs
- validationstate.cs
- SchemaObjectWriter.cs
- SetStoryboardSpeedRatio.cs
- parserscommon.cs
- ValidatorCompatibilityHelper.cs
- PriorityRange.cs
- SharedPersonalizationStateInfo.cs
- SQLInt32Storage.cs