Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SiteMapNodeItemEventArgs.cs
- ImageCollectionEditor.cs
- WebProxyScriptElement.cs
- BitStream.cs
- CachedTypeface.cs
- MatrixAnimationBase.cs
- FormClosedEvent.cs
- HtmlSelect.cs
- SwitchLevelAttribute.cs
- CombinedGeometry.cs
- SafeNativeMethods.cs
- Point3DAnimationUsingKeyFrames.cs
- ScriptResourceAttribute.cs
- ISAPIRuntime.cs
- BamlReader.cs
- TextWriterTraceListener.cs
- Graphics.cs
- SelectionUIService.cs
- XmlSchemaException.cs
- SAPICategories.cs
- DropShadowEffect.cs
- CngKeyBlobFormat.cs
- EndPoint.cs
- CodeCatchClauseCollection.cs
- MsmqIntegrationInputChannel.cs
- DependentList.cs
- FormsAuthenticationConfiguration.cs
- XhtmlBasicValidationSummaryAdapter.cs
- DataSourceHelper.cs
- TakeQueryOptionExpression.cs
- RecognizeCompletedEventArgs.cs
- TreeViewAutomationPeer.cs
- RefreshEventArgs.cs
- Storyboard.cs
- SupportingTokenSecurityTokenResolver.cs
- HttpRequestContext.cs
- CodeTypeMember.cs
- _HelperAsyncResults.cs
- MachineKeySection.cs
- PrintPreviewDialog.cs
- TextTreeExtractElementUndoUnit.cs
- FrugalMap.cs
- SetState.cs
- DbgUtil.cs
- infer.cs
- ErrorStyle.cs
- Models.cs
- WebControlsSection.cs
- EditingCoordinator.cs
- HierarchicalDataBoundControl.cs
- DataGridPagerStyle.cs
- clipboard.cs
- AppManager.cs
- FixedSOMContainer.cs
- IntSecurity.cs
- TypeDescriptionProvider.cs
- CacheHelper.cs
- XmlSchemaSimpleContent.cs
- CharKeyFrameCollection.cs
- OletxDependentTransaction.cs
- MachineKeyConverter.cs
- CacheDependency.cs
- ControlAdapter.cs
- ExcCanonicalXml.cs
- CompilationAssemblyInstallComponent.cs
- NodeFunctions.cs
- SafeNativeMethods.cs
- LongValidatorAttribute.cs
- DbSource.cs
- ReverseInheritProperty.cs
- WpfGeneratedKnownProperties.cs
- SecurityUtils.cs
- CqlGenerator.cs
- PrinterSettings.cs
- PrintingPermission.cs
- XmlElementList.cs
- UnhandledExceptionEventArgs.cs
- XmlAnyAttributeAttribute.cs
- cookiecontainer.cs
- GridViewHeaderRowPresenter.cs
- DrawingGroup.cs
- bindurihelper.cs
- CompositionAdorner.cs
- NameScope.cs
- ActivityExecutorOperation.cs
- DataServiceQuery.cs
- ProfileParameter.cs
- QueryOutputWriter.cs
- XPathDescendantIterator.cs
- SQLChars.cs
- SystemResources.cs
- SafeMemoryMappedFileHandle.cs
- ListControlConvertEventArgs.cs
- Int64.cs
- SoapTypeAttribute.cs
- Themes.cs
- FlatButtonAppearance.cs
- WeakEventTable.cs
- InstanceDescriptor.cs
- TimeSpanSecondsConverter.cs