Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- TimeSpanConverter.cs
- SetMemberBinder.cs
- ReaderWriterLock.cs
- CharacterMetrics.cs
- DataRelationPropertyDescriptor.cs
- SafeReadContext.cs
- ApplicationId.cs
- WebPartEditorCancelVerb.cs
- ThreadInterruptedException.cs
- GeneralTransform3D.cs
- lengthconverter.cs
- PolicyStatement.cs
- InstanceCollisionException.cs
- OracleCommandSet.cs
- BaseTemplateParser.cs
- ComponentEvent.cs
- AppSecurityManager.cs
- ProjectionCamera.cs
- GridViewRowCollection.cs
- PersonalizableAttribute.cs
- AttributeSetAction.cs
- SpeakProgressEventArgs.cs
- CounterCreationDataCollection.cs
- sqlser.cs
- DateTimeValueSerializer.cs
- AppliedDeviceFiltersEditor.cs
- TemplateColumn.cs
- remotingproxy.cs
- MailMessageEventArgs.cs
- RecommendedAsConfigurableAttribute.cs
- DetailsViewUpdateEventArgs.cs
- DataGridTableCollection.cs
- AsymmetricKeyExchangeFormatter.cs
- IisTraceListener.cs
- XmlSchemaComplexContent.cs
- ShortcutKeysEditor.cs
- DragDeltaEventArgs.cs
- DeferredSelectedIndexReference.cs
- NonSerializedAttribute.cs
- AlignmentXValidation.cs
- FolderBrowserDialog.cs
- WinInetCache.cs
- AttributeQuery.cs
- TreeNode.cs
- ContainerParagraph.cs
- SamlSerializer.cs
- EmptyStringExpandableObjectConverter.cs
- SkinIDTypeConverter.cs
- NullableFloatAverageAggregationOperator.cs
- SafeTimerHandle.cs
- WmlValidatorAdapter.cs
- PackWebResponse.cs
- SoapSchemaExporter.cs
- JsonFormatReaderGenerator.cs
- Pen.cs
- FilteredAttributeCollection.cs
- CredentialCache.cs
- XmlSchemaGroup.cs
- ChildrenQuery.cs
- ServerIdentity.cs
- CertificateManager.cs
- SecurityElement.cs
- ProgressBarHighlightConverter.cs
- SizeAnimation.cs
- DecimalConverter.cs
- InputProcessorProfiles.cs
- DbExpressionVisitor_TResultType.cs
- ClientData.cs
- WhitespaceRuleLookup.cs
- SecurityVersion.cs
- ByeMessageApril2005.cs
- GeneralTransform3D.cs
- DataGridViewCheckBoxCell.cs
- ZipFileInfo.cs
- EditorAttribute.cs
- TextElementAutomationPeer.cs
- CodePropertyReferenceExpression.cs
- ScriptingJsonSerializationSection.cs
- CharStorage.cs
- ContentType.cs
- ImageListUtils.cs
- StringStorage.cs
- COM2ExtendedTypeConverter.cs
- DoubleLinkList.cs
- XslTransformFileEditor.cs
- BamlTreeUpdater.cs
- InProcStateClientManager.cs
- NativeObjectSecurity.cs
- ClosableStream.cs
- DataServiceCollectionOfT.cs
- PreservationFileWriter.cs
- MethodInfo.cs
- userdatakeys.cs
- connectionpool.cs
- PreProcessor.cs
- Types.cs
- FrameworkContextData.cs
- Byte.cs
- InternalMappingException.cs
- HwndSourceKeyboardInputSite.cs