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
- SpellCheck.cs
- MetaColumn.cs
- MatrixTransform.cs
- ButtonFieldBase.cs
- DeadCharTextComposition.cs
- ProcessHostServerConfig.cs
- XmlCollation.cs
- UnsafeNativeMethods.cs
- ReadOnlyDataSource.cs
- ELinqQueryState.cs
- StoreItemCollection.cs
- MethodBody.cs
- WebPartConnectionsCloseVerb.cs
- PackageStore.cs
- BitmapData.cs
- DiscoveryServerProtocol.cs
- PropertyBuilder.cs
- StandardOleMarshalObject.cs
- QualifiedCellIdBoolean.cs
- KeyValuePairs.cs
- GeneralTransform3DCollection.cs
- SecurityToken.cs
- StreamProxy.cs
- PolygonHotSpot.cs
- DoubleLink.cs
- ETagAttribute.cs
- BindingGroup.cs
- SchemaSetCompiler.cs
- SizeConverter.cs
- ComponentEditorForm.cs
- CodeDefaultValueExpression.cs
- EntityException.cs
- KeyValueConfigurationCollection.cs
- TableLayoutStyleCollection.cs
- DescendentsWalker.cs
- XmlSerializer.cs
- WebRequestModuleElement.cs
- AspProxy.cs
- ImageCodecInfoPrivate.cs
- SynchronizationContext.cs
- OdbcInfoMessageEvent.cs
- XmlSchemaComplexContentRestriction.cs
- ConfigurationValues.cs
- XmlIlVisitor.cs
- SemanticBasicElement.cs
- DataBindingCollectionConverter.cs
- CommandEventArgs.cs
- ValueExpressions.cs
- Int32RectValueSerializer.cs
- Point4DValueSerializer.cs
- ReachPageContentCollectionSerializerAsync.cs
- IsolatedStorage.cs
- Soap.cs
- ContextMenuStrip.cs
- OutOfMemoryException.cs
- ViewCellRelation.cs
- EntityViewGenerator.cs
- ExtensionWindowHeader.cs
- ClassDataContract.cs
- PopupRoot.cs
- SchemaNotation.cs
- ImageBrush.cs
- ExpandSegment.cs
- XmlSchemaComplexType.cs
- WindowsStatusBar.cs
- NonSerializedAttribute.cs
- TransformGroup.cs
- GPRECT.cs
- DateRangeEvent.cs
- DetailsViewInsertEventArgs.cs
- RadioButton.cs
- TimeZone.cs
- MaterialGroup.cs
- CustomAttributeBuilder.cs
- NavigationHelper.cs
- XmlAnyElementAttribute.cs
- UniqueConstraint.cs
- UserPreferenceChangingEventArgs.cs
- ApplicationServicesHostFactory.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- GenericAuthenticationEventArgs.cs
- ControlType.cs
- TextAction.cs
- DictionaryManager.cs
- DBNull.cs
- LocalBuilder.cs
- EntityObject.cs
- PageCodeDomTreeGenerator.cs
- SafeWaitHandle.cs
- Error.cs
- safelinkcollection.cs
- BamlBinaryWriter.cs
- DefaultWorkflowTransactionService.cs
- RequestSecurityToken.cs
- TrailingSpaceComparer.cs
- cookiecollection.cs
- ModelFactory.cs
- PropertyEmitter.cs
- ManipulationPivot.cs
- filewebrequest.cs