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
- AccessKeyManager.cs
- CodeTryCatchFinallyStatement.cs
- JavaScriptSerializer.cs
- CompilerError.cs
- AdRotator.cs
- ListViewUpdateEventArgs.cs
- SqlNotificationEventArgs.cs
- InheritanceContextHelper.cs
- Parser.cs
- ThaiBuddhistCalendar.cs
- TextEditorThreadLocalStore.cs
- PageTheme.cs
- ScalarOps.cs
- SafeRegistryKey.cs
- ShellProvider.cs
- UIElement3DAutomationPeer.cs
- TypeUsage.cs
- Localizer.cs
- CodeTypeDelegate.cs
- PropertyFilterAttribute.cs
- FontNameEditor.cs
- OAVariantLib.cs
- GlyphCache.cs
- Int32Rect.cs
- ToolStripItem.cs
- DataGridViewCheckBoxColumn.cs
- HiddenFieldPageStatePersister.cs
- ConnectionProviderAttribute.cs
- BinaryCommonClasses.cs
- StringWriter.cs
- SqlDataSourceConnectionPanel.cs
- HiddenFieldPageStatePersister.cs
- ProxyHelper.cs
- ApplyTemplatesAction.cs
- KeyboardEventArgs.cs
- StdValidatorsAndConverters.cs
- UpdateEventArgs.cs
- CalculatedColumn.cs
- WsdlEndpointConversionContext.cs
- BrowserCapabilitiesCodeGenerator.cs
- DataProtection.cs
- NavigateEvent.cs
- X509CertificateCollection.cs
- MergeFilterQuery.cs
- CompoundFileStreamReference.cs
- MouseActionValueSerializer.cs
- RankException.cs
- UidManager.cs
- TextBoxAutoCompleteSourceConverter.cs
- ProcessHostServerConfig.cs
- SetIterators.cs
- CipherData.cs
- StreamingContext.cs
- GlyphManager.cs
- SortQuery.cs
- COM2ColorConverter.cs
- RelationshipDetailsRow.cs
- Process.cs
- BindingGroup.cs
- EncodingNLS.cs
- TargetParameterCountException.cs
- QualifiedCellIdBoolean.cs
- AsyncWaitHandle.cs
- QueryAsyncResult.cs
- DbProviderServices.cs
- QuadTree.cs
- XsltContext.cs
- SQLMoney.cs
- Int32.cs
- PropertyFilter.cs
- MemberNameValidator.cs
- TextHidden.cs
- IsolatedStorageFile.cs
- _ConnectionGroup.cs
- TableChangeProcessor.cs
- DefaultBinder.cs
- AvTraceFormat.cs
- sqlstateclientmanager.cs
- QilBinary.cs
- InstanceDescriptor.cs
- ScrollBar.cs
- DataGridViewTextBoxCell.cs
- HtmlTernaryTree.cs
- EmptyEnumerable.cs
- PrimitiveXmlSerializers.cs
- SQLByte.cs
- ObjectIDGenerator.cs
- IndicShape.cs
- DrawingAttributesDefaultValueFactory.cs
- SrgsRulesCollection.cs
- ActivityExecutorDelegateInfo.cs
- CustomErrorsSection.cs
- Win32.cs
- SimpleHandlerBuildProvider.cs
- WebServiceData.cs
- ProfileProvider.cs
- ConfigViewGenerator.cs
- FontUnitConverter.cs
- ReadOnlyObservableCollection.cs
- Latin1Encoding.cs