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
- TextInfo.cs
- QuaternionValueSerializer.cs
- ProbeDuplexCD1AsyncResult.cs
- AbstractDataSvcMapFileLoader.cs
- GlobalEventManager.cs
- ValueProviderWrapper.cs
- AnimationClockResource.cs
- StructuredCompositeActivityDesigner.cs
- CodeGroup.cs
- OracleCommandBuilder.cs
- HierarchicalDataBoundControl.cs
- ASCIIEncoding.cs
- StaticDataManager.cs
- WaitForChangedResult.cs
- ListViewDeletedEventArgs.cs
- Model3D.cs
- DrawingContextWalker.cs
- ValidationResult.cs
- TaskFormBase.cs
- TextBoxBase.cs
- ServiceConfigurationTraceRecord.cs
- XmlDocumentFragment.cs
- ControlBuilder.cs
- PolicyReader.cs
- LayoutSettings.cs
- PlainXmlWriter.cs
- HashMembershipCondition.cs
- TreeNodeClickEventArgs.cs
- HwndTarget.cs
- BinaryExpressionHelper.cs
- PropertyGridCommands.cs
- SoundPlayer.cs
- OutputCacheSection.cs
- EmbeddedMailObjectsCollection.cs
- invalidudtexception.cs
- InsufficientMemoryException.cs
- BindableTemplateBuilder.cs
- StringOutput.cs
- BindingMAnagerBase.cs
- _CommandStream.cs
- FilteredSchemaElementLookUpTable.cs
- TextTreePropertyUndoUnit.cs
- MdImport.cs
- CodeDOMUtility.cs
- ExtenderProviderService.cs
- _BaseOverlappedAsyncResult.cs
- TimeoutHelper.cs
- RelOps.cs
- ContentPropertyAttribute.cs
- XhtmlBasicPageAdapter.cs
- XmlUtil.cs
- TemplateBamlRecordReader.cs
- PropertyValueChangedEvent.cs
- WindowsMenu.cs
- StringHandle.cs
- Message.cs
- DataGridHelper.cs
- NaturalLanguageHyphenator.cs
- PipeException.cs
- XPathBuilder.cs
- EntityDataSourceContextDisposingEventArgs.cs
- XmlQueryStaticData.cs
- Container.cs
- ScriptManager.cs
- XmlHierarchyData.cs
- ContextBase.cs
- DataViewSettingCollection.cs
- XPathException.cs
- ClientSponsor.cs
- OleDbParameter.cs
- RoleManagerSection.cs
- CompilationSection.cs
- ReferentialConstraint.cs
- TableProvider.cs
- XmlSchemaComplexContent.cs
- DateTimeConverter2.cs
- TextViewSelectionProcessor.cs
- ParameterModifier.cs
- CopyAction.cs
- FilterableAttribute.cs
- ApplicationBuildProvider.cs
- RowSpanVector.cs
- ResourcePart.cs
- FrameAutomationPeer.cs
- SHA384Managed.cs
- Encoder.cs
- PointUtil.cs
- HMACSHA384.cs
- FtpWebRequest.cs
- TCPListener.cs
- DetailsViewUpdateEventArgs.cs
- MetaForeignKeyColumn.cs
- DataGridView.cs
- GeneralTransformCollection.cs
- CatchBlock.cs
- AxisAngleRotation3D.cs
- DataServiceBehavior.cs
- DotAtomReader.cs
- LowerCaseStringConverter.cs
- EventData.cs